Standardization

Trip Report: ISO C++ Spring 2013 Meeting, Part 3 -- Michael Wong

iconNoCommunityPhoto155.pngPart 3 of Michael Wong's trip report:

The view from C++ Standard meeting April 2013 Part 3

by Michael Wong

In this series that looks at C++14 content, we looked at features from Language and Library for C++14. Now we will look at Concurrency which is the other group that contributed features for C++14. In reality, some of the features from Language and Library also came from Concurrency. ...

Trip Report: ISO C++ Spring 2013 Meeting, Part 2 -- Michael Wong

iconNoCommunityPhoto155.pngPart 2 of Michael Wong's trip report:

The view from C++ Standard meeting April 2013 Part 2

by Michael Wong

In part 1 of this trip report, I spoke about the general mood of the April C++ Std meeting in Bristol and the plan to release C++14 [Committee] Draft (CD) after the meeting. I also deep dived into the language feature set for C++14.

Now I will deep dive onto the library feature additions for C++14. As with the language features, some of these originated from other subgroups. As before, I will not talk about minor bug fixes, but also talk about proposals that did not pass as they are often the most controversial. ...

Trip Report: ISO C++ Spring 2013 Meeting -- Michael Wong

iconNoCommunityPhoto155.pngA trip report from Michael Wong:

The view from C++ Standard meeting April 2013 Part 1

by Michael Wong

... Our goal was to triage all features that can enter C++14. This means C++14 is more than just bug fixes and is unlike a Technical Corrigendum like TC1 which bridged C++ 1998 to C++2003. As such it will have additional features beyond defect fixes that has been deemed to be small enough in scope and solution but significant enough in annoyance that it should be fixed immediately post C++11...

Here are the new language extensions voted in...

Thanks to our Bristol hosts!

I would like to personally thank (again) our hosts for last week's ISO C++ standards meeting in Bristol, notably Roger Orr and our U.K. national body host BSI, as well as the sponsors who supported the meeting financially and otherwise: ACCU, Google, Archer-Yates, Getco, Red Hat, and Gnu C++ User.

  

Our hosts and sponsors not only provided great facilities, but demonstrated grace under pressure when the registered attendee count rose beyond expectations weeks before the meeting, and then continued to rise, ending up far above recent attendance records. Our hosts rose to the occasion, providing meeting space for more national body experts and more subgroups meeting in parallel than we've seen for some 15 years. And they generously fed everyone lunch each day for six days, going well above and beyond expectations. (The hosts for the Chicago meeting this fall have taken notice and are preparing accordingly, and we appreciate their generosity as well.)

Aside: My trip report graph shows that there were 100 experts attending last week, but that's conservative. We had 102 pre-registered to attend, and it looks like the final count will be 107 at the meeting; I'm waiting for the confirmed number and will update that trip report when I get it. For comparison, up till 2011 the average meeting attendance was half that.

Thanks again, Roger and BSI and all of our meeting sponsors! It was a well-hosted, smoothly run, and very productive meeting. Thank you.

New adopted paper: N3659, Shared Locking in C++ -- Howard Hinnant, Detlef Vollmann, Hans Boehm

Note: This paper was adopted into draft C++14 on Saturday at the Bristol UK ISO C++ meeting.

A new WG21 paper is available. A copy is linked below, and the paper will also appear in the next normal WG21 mailing. If you are not a committee member, please use the comments section below or the std-proposals forum for public discussion.

Document number: N3659

Date: 2013-04-19

Shared locking in C++ (a.k.a. reader/writer locks)

by Howard Hinnant, Detlef Vollmann, Hans Boehm

Excerpt:

N3568 was presented at the Spring 2013 meeting in Bristol to SG1 (Concurrency and Parallelism). The decision was to bring shared_mutex only forward for C++14. Also the specification should allow for spurious failures.

 

From N3568:

This proposal adds functionality to allow clients to easily code the well-known multiple-readers / single-writer locking pattern. ...

... a shared_mutex can be locked in one of two ownership modes:

  1. Exclusive, using lock(), or
  2. Shared, using lock_shared().

... The recommended pattern for locking a shared_mutex in shared ownership mode is not to call m.lock_shared() directly, but to use shared_lock<shared_mutex>:

shared_mutex mut;
...
void foo()
{
     shared_lock<shared_mutex> _(mut);
     // mut lock_shared'd here
     // ...
}    // mut.unlock_shared() called here

New adopted paper: N3672, std::optional (Revision 4) -- Fernando Cacciola, Andrzej KrzemieĊ„ski

Note: This paper was adopted into draft C++14 on Saturday at the Bristol UK ISO C++ meeting.

A new WG21 paper is available. A copy is linked below, and the paper will also appear in the next normal WG21 mailing. If you are not a committee member, please use the comments section below or the std-proposals forum for public discussion.

Document number: N3672

Date: 2013-04-19

A proposal to add a utility class to represent optional objects (Revision 4)

by Fernando Cacciola and Andrzej Krzemieński

Excerpt:

The basic usage of optional<T> can be illustrated with the following example.

optional<int> str2int(string);    // converts int to string if possible

int get_int_form_user()
{
  string s;

  for (;;) {
    cin >> s;
    optional<int> o = str2int(s); // 'o' may or may not contain an int
    if (o) {                      // does optional contain a value?
      return *o;                  // use the value
    }
  }
}

 

New adopted paper: N3655 (excluding part 4), TransformatinTraits Redux, v2 -- Walter Brown

Note: This paper was adopted into draft C++14 on Saturday at the Bristol UK ISO C++ meeting.

A new WG21 paper is available. A copy is linked below, and the paper will also appear in the next normal WG21 mailing. If you are not a committee member, please use the comments section below or the std-proposals forum for public discussion.

Document number: N3655

Date: 2013-04-18

TransformationTraits Redux, v2

by Walter Brown

NOTE: Section 4 was not adopted.

Excerpt:

... We therefore propose to add a set of template aliases for the library’s TransformationTraits in order to reduce the programmer burden of expressing this far more common case. Note, in the following rewrite of the above example, the absence of any typename keyword, as well as the absence of any ::type suffix, thus condensing the statement from 3 to 2 lines of code:


template< class T > using reference_t
  = conditional_t< is_reference<T>::value, T, add_lvalue_reference_t<T> >;

New adopted paper: N3642, User-defined Literals for Standard Library Types (pt1 v4) -- P. Sommerlad

Note: This paper was adopted into draft C++14 on Saturday at the Bristol UK ISO C++ meeting.

A new WG21 paper is available. A copy is linked below, and the paper will also appear in the next normal WG21 mailing. If you are not a committee member, please use the comments section below or the std-proposals forum for public discussion.

Document number: N3642

Date: 2013-04-18

User-defi ned Literals for Standard Library Types (part 1 - version 4)

by Peter Sommerlad

This allows code like the following:

auto mystring = "hello world"s;   // type std::string

auto mytime = 42ns;               // type chrono::nanoseconds

 

New adopted paper: N3654, Quoted Strings Library Proposal (Revision 2) -- Beman Dawes

Note: This paper was adopted into draft C++14 on Saturday at the Bristol UK ISO C++ meeting.

A new WG21 paper is available. A copy is linked below, and the paper will also appear in the next normal WG21 mailing. If you are not a committee member, please use the comments section below or the std-proposals forum for public discussion.

Document number: N3654

Date: 2013-04-19

Quoted Strings Library Proposal (Revision 2)

by Beman Dawes

Excerpt:

The proposed quoted stream I/O manipulator places delimiters, defaulted to double-quote ("), around strings on output, and strips off the delimiters on input. This ensures strings with embedded white space round-trip as desired. For example,

std::stringstream ss;
std::string original = "foolish me";
std::string round_trip;

ss << quoted(original);
ss >> quoted(round_trip);

std::cout << original;     // outputs: foolish me
std::cout << round_trip;   // outputs: foolish me

assert(original == round_trip); // assert will not fire

If the string contains the delimiter character, on output that character will be preceded by an escape character, default to backslash (\), as will the escape character itself:

std::cout << quoted("She said \"Hi!\"");  // outputs: "She said \"Hi!\""

 

New adopted paper: N3656, make_unique (Revision 1) -- Stephan T. Lavavej

Note: This paper was adopted into draft C++14 on Saturday at the Bristol UK ISO C++ meeting.

A new WG21 paper is available. A copy is linked below, and the paper will also appear in the next normal WG21 mailing. If you are not a committee member, please use the comments section below or the std-proposals forum for public discussion.

Document number: N3656.txt

Date: 2013-04-18

make_unique (Revision 1)

by Stephan T. Lavavej

The paper includes source code for a complete implementation.