New paper: N3763, Traversable Arguments for Container Constructors and ..., Wording Rev 4 -- Yasskin

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: N3763

Date: 2013-09-01

Traversable arguments for container constructors and methods, wording revision 4

by Jeffrey Yasskin

Excerpt:

The STL brought the notion of a range to C++, expressed as a pair of iterators. C++11 added the range-based for loop, which iterates over a single object for which begin(x) and end(x) return that pair of iterators. The Boost.Range library extends this to a full library of algorithms based on ranges as single objects. We don't yet know the full design of the library we want to standardize, but a simple step we already know is needed is to allow the output of that library to be passed to existing functions in the standard library that already take an iterator-pair range.

New paper: N3762, string_view: a non-owning reference to a string, revision 5 -- Jeffrey Yasskin

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: N3762

Date: 2013-09-01

string_view: a non-owning reference to a string, revision 5

by Jeffrey Yasskin

Excerpt:

References to strings are very common in C++ programs, but often the callee doesn't care about the exact type of the object that owns the data. ...

Google, LLVM, and Bloomberg have independently implemented a string-reference type to encapsulate this kind of argument. string_view is implicitly constructible from const char* and std::string. It provides the const member operations from std::string to ease conversion. This paper follows Chromium and Bloomberg in extending string_view to basic_string_view<charT>, and further extends it to include a traits parameter to match basic_string. We provide typedefs to parallel the 4 basic_string typedefs.

Both Google's and LLVM's string_view types (but not Bloomberg's) extend the interface from std::string to provide some helpful utility functions:

Versions of std::string operations that take string_view instead also give the standard a way to provide in-place operations on non-null-terminated byte/character sequences:

  • hash, as requested by c++std-lib-31935
  • In a future addition, numeric conversions

New paper: N3766, The identity Type Transformation -- Jeffrey Yasskin

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: N3766

Date: 2013-09-03

The identity type transformation

by Jeffrey Yasskin

Excerpt:

The need for the identity type transformation and backward-compatibility with the SGI library are still around, so this paper proposes two (mutually exclusive) options for nearly achieving both.

GoingNative will be livestreamed this week: Sep 4-6

The GoingNative 2013 conference starts Wednesday and is just about sold out. A few seats remain, so register now (or get on the waitlist in case there's a last-minute cancellation you can snag).

It's decidedly desirable to be physically in the room to get the full experience, and hundreds of people from over 10 countries are already on their way. But if you can't come in person to Redmond, WA, USA for this week's C++ fest, you'll be glad to know the talks will be livestreamed as well on the Channel 9 homepage. The streaming is compatible with all major platforms. For those of you around the world, please note that the talk times are in North American Pacific Daylight Time.

Talks include the following, including both full-length talks and a number of 20- and 30-minute "nuggets."

Day 1: Wed Sep 4

  • Opening Keynote: The Essence of C++ -- With Examples in C++84, C++98, C++11, and C++14 (Bjarne Stroustrup)
  • C++ Seasoning (Sean Parent)
  • Writing Quick Code in C++, Quickly (Andrei Alexandrescu)
  • Don’t Help the Compiler (Stephan T. Lavavej)
  • Compiler++ (Jim Radigan)

Day 2: Thu Sep 5

  • Day 2 Keynote: One C++ (Herb Sutter)
  • rand() Considered Harmful (Stephan T. Lavavej)
  • An Effective C++11/14 Sampler (Scott Meyers)
  • C++14: Through the Looking Glass (Michael Wong)
  • The Care and Feeding of C++’s Dragons (Chandler Carruth)
  • Interactive Panel: Ask Us Anything! (speakers)

Day 3: Fri Sep 6

  • Everything You Always Wanted to Know About Threading (But...) (Elliot H. Omiya)
  • The Way of the Exploding Tuple (Andrei Alexandrescu)
  • To Move or Not to Move: That is the Question (Michael Wong)
  • Bringing await to C++ (Deon Brewis)
  • A C++ REST SDK: OSS web services on Windows and Linux (Niklas Gustafsson)
  • Compiler Confidential (Eric Brumer)
  • Find-Build-Share-Use: Using NuGet for C and C++ Libraries (Garrett Serack)
  • My Favorite C++ 10-Liner (Herb Sutter)

 

C++ Conferences This Fall

I've created a short overview over the C++ Conferences this Fall:

  • Going Native (Seattle, 4.th-6.9) SOLD OUT
  • International Workshop on OpenMP (Canberra (AU), 16-18.9)
  • (not a conference, but...) Fall ISO C++ meeting (Chicago, 23-28.9)
  • QtDevDays Europe (Berlin, 7th - 9.10)
  • QtDevDays US (San Francisco, 6th-8.11)
  • Meeting C++ 2013 (Düsseldorf, 8th-9.11)
  • C++ and Beyond (Snoqualmie Falls (WA/US), 9th-12.12) SOLD OUT

More details at Meeting C++

by Jens Weller

New paper: N3710, Specifying the absence of "out of thin air" results (LWG2265) -- Hans Boehm et al.

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: N3710

Date: 2013-08-29

Specifying the absence of "out of thin air" results (LWG2265)

by Hans Boehm, Mark Batty, Brian Demsky, Olivier Giroux, Paul McKenney, Peter Sewell, Francesco Zappa Nardelli, et al.

Excerpt:

The C++11 memory model specified the semantics of shared ordinary and atomic objects. There is one small part of this specification that we always recognized was dubious. The specification in 1.10 of weakly ordered atomics allows an atomic load to essentially see, or not see, the result of any racing store. In the case of explicit very weak memory ordering specifications, this can lead to "causal cycles" and highly counterintuitive results. ...

Essentially this issue has been an open issue in the Java specification for about 10 years. The major advantage that we have in C++ is that the problem is confined to non-synchronizing atomics, i.e. memory_order_relaxed, and some memory_order_consume uses (or read-modify-write operations that effectively weaken the ordering on either the read or write to one of those). Many of us expect those to be rarely used. ...

This proposal benefitted from a lengthy email discussion involving participants listed at the beginning of this paper, and others. This provided very useful input resulting in improvements to this proposal. It unfortunately resulted in neither a clear consensus in that group, nor an alternate proposal with clearly better consensus behind it. Not all of the listed contributors necessarily support this proposal. Since I don't believe there is support for maintaining the status quo, I nonetheless bring forward this proposal. Mark Batty and Peter Sewell are currently considering submitting additional late papers on this topic, including an alternate proposal. ...

New paper: N3709: Minutes for July 2013 Santa Clara SG1 Meeting -- J Hoberock, A Mackintosh, H Boehm

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: N3709

Date: 2013-08-29

Minutes for July 2013 Santa Clara SG1 Meeting

by Jared Hoberock, Alasdair Mackintosh, Hans Boehm

Excerpt:

This meeting took place July 25-26, in Santa Clara, CA. We thank Nvidia for hosting the meeting.

New paper: N3722, Resumable Functions -- Niklas Gustafsson, Deon Brewis, Herb Sutter, Sana Mithani

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: N3722

Date: 2013-08-30

Resumable Functions

by Niklas Gustafsson, Deon Brewis, Herb Sutter, Sana Mithani

Excerpt:

While presenting a proposal that can be adopted or rejected in isolation, this document is related to N3721. The reader is advised to read both as a unit and to consider how the two build on each other for synergy. Reading them in their assigned numeric order is strongly advised.

New in this version: proposed wording for a TS, including language to generalize its applicability to other types than future/shared_future; a section on a possible extension to include generator functions; going back to use of the word ‘resumable’ instead of ‘async’ as the syntactic marker of resumable functions.

New paper: N3721, Improvements to std::future and Related APIs -- Gustafsson Laksberg Sutter Mithani

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: N3721

Date: 2013-08-30

Improvements to std::future and Related APIs

by Niklas Gustafsson, Artur Laksberg, Herb Sutter, Sana Mithani

Excerpt:

This proposal is an evolution of the functionality of std::future/std::shared_future. It details additions which can enable wait free compositions of asynchronous operations.

This document supersedes N3634: the title has been changed, and the proposed changes have been modified to be expressed as edits to the C++ Draft Standard.

New in this version: implicit unwrapping (one level) of future<future<R>> to future<R> in then().

... C++ suffers an evident deficit of asynchronous operations compared to other languages, thereby hindering programmer productivity. JavaScript on Windows 8 has promises (then, join and any), .NET has the Task Parallel Library (ContinueWith, WhenAll, WhenAny), C#/VB has the await keyword (asynchronous continuations), and F# has asynchronous workflows. When compared to these languages, C++ is less productive for writing I/O-intensive applications and system software. In particular writing highly scalable services becomes significantly more difficult. ...