May 2014

N3982: Rvalue reference overloads for optional -- Andrzej KrzemieĊ„ski

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

Date: 2014-04-03

Rvalue reference overloads for optional

by Andrzej Krzemieński

Excerpt:

... optional is just missing the rvalue reference overloads for these functions. This is what this proposal intends to fix: add rvalue reference overloads for member functions value and operator* (not for operator->, because it appears not to be implementable). I consider it a bug fix rather than a new feature, primarily because such an overload already exists and has been approved for function value_or. This is why I propose to fix it still in the first version of Fundamentals TS.

N3981: Removing trigraphs??! -- Richard Smith

[Ed: This one might get the pre-Rapperswil mailing award for funniest title... Thanks for the chuckle, Richard.]

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

Date: 2014-05-06

Removing trigraphs??!

by Richard Smith

Excerpt:

Trigraphs continue to pose a burden on users of C++.

This paper proposes that trigraphs be removed entirely.

N3973: A Proposal to Add a Logical Const Wrapper -- Jonathan Coe and Robert Mill

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

Date: 2014-05-12

A Proposal to Add a Logical Const Wrapper to the Standard Library Technical Report

by Jonathan Coe and Robert Mill

Excerpt:

We propose the introduction of a logical_const wrapper class that propagates const-ness to pointer-like (or reference-like) member variables.

N3972: Source-Code Information Capture -- Robert Douglas

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

Date: 2014-05-17

Source-Code Information Capture

by Robert Douglas

Excerpt:

In Issaquah, I presented the idea of "Call-Site Informed Default Variables" to the reflection study group, to get a sense of what direction to pursue. The goal was to craft a feature to allow a function to capture information about the source code calling it, moving toward obsoleting function-macros for these use cases. The response from the room was largely positive, and requests were focused on the desire to present a means to convey source code information to be passed to a function. This proposal seeks to do just that.

N4010-12: Evolution Issues Lists -- Ville Voutilainen

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 numbers: N4010-12

Date: 2014-02-28

C++ Standard Evolution Active Issues List (Revision R07)

C++ Standard Evolution Completed Issues List (Revision R07)

C++ Standard Evolution Closed Issues List (Revision R07)

by Ville Voutilainen

Excerpt:

The purpose of this document is to record the status of issues which have come before the Evolution Working Group (EWG) of the INCITS PL22.16 and ISO WG21 C++ Standards Committee. Issues represent potential defects in the ISO/IEC IS 14882:2003(E) document, and proposed extensions to it.

CppCon: My Proposed Talks (Part 1) -- Herb Sutter

cppcon-109.PNGWith the CppCon talk submission deadline upon us, we're starting to get glimpses of the potential CppCon conference program. In today's post, Herb Sutter mentions three of his five talk proposals (note: pending review and selection by the program committee, so this is not final -- they may or may not be selected if there is stronger material).

CppCon: My Proposed Talks (Part 1)

by Herb Sutter

From the post:

Lock-Free Programming – or, How to Juggle Razor Blades (~2 hours)

Example-driven talk on how to design and write lock-free algorithms and data structures using C++ atomic<> – something that can look deceptively simple, but contains very deep topics. (Important note: This is not the same as my "atomic<> Weapons" talk; that talk was about the "what they are and why" of the C++ memory model and atomics, and did not cover how to actually use atomics to implement highly concurrent algorithms and data structures.)

This talk is about the "how to use them successfully" part of atomics, including:

  • Best practices and style for using atomic<>s
  • Three or more examples, including lock-free mail slots and iterations of a lock-free linked list, all in portable Standard C++
  • Defining and applying the different levels of "lock-freedom" (wait-free, lock-free, obstruction-free) to develop highly concurrent algorithms and data structures
  • Explaining and applying key concepts including especially: linearizability; trading off concurrency vs. promptness; and trading off concurrency vs. throughput/utilization
  • Demonstrating and solving the ABA problem, with clean and simple code – that's right, did you know that in C++11 you can solve this without relying on esoterica like double-wide CAS (which isn’t always available) or hazard pointers (which are deeply complex) or garbage collection (which isn’t in the C++ standard... yet)?

Standardization Update: C++14 and the Seven Dwarfs (1 hour)

Standardization has accelerated: By the time we meet at CppCon, C++14 might already be ratified. But that's only one of eight (so far) work items now in flight. In this session, I'll give a brief summary of the new features coming in C++14 itself, and then a tour of the seven (7) near-term separate Technical Specifications already underway – think of these as the "C++14 wave" of deliverables.

The ISO C++ committee has transitioned to a "decoupled" model where updated versions of the standard are published more frequently, while at the same time major pieces of work can progress and be published independently from the Standard itself and delivered asynchronously in the form of Technical Specifications (TS’s) that are separate from the main Standard and can later be incorporated into the Standard. Come to this session to see how this is helping both the standard and C++ compiler implementations near you stay current with the latest in C++.

The topics covered will be:

  • C++14: What’s new in the new standard due this year
  • File System TS: Portable file system access
  • Library Fundamentals TS (small): string_view and optional<>
  • Array Extensions TS: Language and library dynamic arrays
  • Concepts Lite TS: Templates + constraints = ++usability and ++diagnostics
  • Concurrency TS: Nonblocking futures (.then, .when_*), executors, and (maybe) await
  • Parallelism TS: A whole new Parallel STL with both parallel and vector execution support
  • One of:
        – Networking TS (small): IP addresses, URIs, byte ordering
        – Transactional Memory TS: Language and library extensions for transactional memory instead of mutexes for many kinds of concurrency control

This session will present an overview of each set of features, what it looks like and how to use it, and why it’s important for the standard and for your own portable C++ code.

Modern C++ Style: Idioms of C++11/14 (1 to 3 hours)

This session will cover modern and current C++ style, focusing on C++14. It will demonstrate how major features and idioms from C++98 are now entirely replaced or subsumed and should be used no more; how other major features and idioms have been dramatically improved to the point where your code is cleaner and safer and you’ll even think in a different style; and how pervasive styles as common as variable declarations are changed forever, and not just for style but for serious technical safety and efficiency benefits. For one thing, you’ll never look at auto the same way again – and if hearing that makes you worry, worry not, just attend the session to dig deep into the good reasons for the new reality.

Why C++14? Two reasons: First, it really does "complete C++11" with small but important consistency features like generic lambdas and make_unique that let us teach modern C++ style with fewer “except for” footnotes. Second, C++14 “is” C++ for the next several years and it’s real; it is feature-complete and in the final stages of standardization, and more importantly we are already seeing near-complete conforming implementations becoming widely available around the same time C++14 is expected to be formally published.

C++14 is a small but important improvement on C++11 that really does complete the language. What this means is that we’re going to have a complete and simpler set of idioms and styles to learn and use.
 

just::thread C++11 and C++14 Thread Library V2.0 released

just::thread 2.0 is now available.

Anthony Williams' implementation of the C++11 and C++14 threading library adds support for gcc 4.8 and Microsoft Visual Studio 2013 and with a number of new features.

just::thread now includes:

  • The new std::shared_timed_mutex and std::shared_lock from C++14 allow for multiple readers to hold a shared lock on a mutex or one writer to hold an exclusive lock.

  • The extensions to the futures from the upcoming C++ Concurrency Technical Specification in the form of continuations. std::future<> and std::shared_future<> now have an additional member function "then()" which allows a further task to be scheduled when the future becomes "ready". This allows for improved support for asynchronous tasks.

  • jss::when_any and jss::when_all encapsulate a set of futures into a single future which becomes ready when either one or all of the provided futures becomes ready. This can be used with continuations to schedule asynchronous tasks to run when the prerequisites are ready.

  • A new lock wrapper jss::generic_lock_guard is provided. This is a concrete type rather than a template, and will lock any type of mutex which provides lock and unlock member functions.

Very Strong C++ Track at the NDC Conference [June 2-6, Oslo, Norway] -- Anders Schau Knatten

A useful reminder:

Very Strong C++ Track at the NDC Conference [June 2-6, Oslo, Norway]

by Anders Schau Knatten

From the article:

... there’ll be no less than 13 talks, by Nico Josuttis, Scott Meyers, Andrei Alexandrescu, Hubert Matthews, Mike Long, Isak Styf, Ismail Pazarbasi, Olve Maudal, and myself. In addition, Andrei Alexandrescu will give a two day workshop. Here’s the full list:

Stopping the Spew -- Tony DaSilva

Today on Bulldozer00:

Stopping the Spew!

by Tony DaSilva

From the article:

Every C++ programmer has experienced at least one, and most probably many, “Template Spew” (TS) moments. You know you’ve triggered a TS moment when, just after hitting the compile button on a program the compiler deems TS-worthy, you helplessly watch an undecipherable avalanche of error messages zoom down your screen at the speed of light. ...

... Fear not, because help is on the way via C++14 in the form of "concepts lite".