June 2013

New paper: N3697, WG21 Business Plan and Convener's Report -- Herb Sutter

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

Date: 2013-06-25

WG21 Business Plan and Convener's Report

by Herb Sutter



ISO C++ remains a widely-used foundation technology, well-received in the marketplace.

Although C++ has long been a consistently popular language, since 2011 in particular it has enjoyed a renewed cycle of growth and investment in tools and platform support across the industry. This was driven primarily by the C++11 standard's completion at the same time as the industry saw a resurgence of interest in performance-efficient, hardware-efficient, and especially power-efficient systems programming capability for mobile devices, cloud data centers, high-performance financial systems, vector and GPGPU computing (via nonstandard extensions to C++ that we are now investigating standardizing), and other major growth sectors and environments.

This new cycle of industry investment in C++ includes, but is not limited to, investment in:
  • tools, such as the advent of a new major C++ implementation in the Clang compiler and other major new products actively competing to fully implement the latest ISO C++ standard;
  • organization, with the establishment of the Standard C++ Foundation trade association in 2012 (see isocpp.org/about);
  • standardization participation, so that at our most recent meeting WG21 attendance reached 107 experts organized into 16 active subgroups -- this includes 12 domain-specific subgroups (e.g., networking, transactional memory) that were established since 2012 and have drawn domain experts who did not previously participate in C++ standardization; and
  • faster and more predictable standardization output, for example that WG21 is on track to produce in 2014 a "C++14 wave" of one revised International Standard and three Technical Specifications (File System library, Networking library, and Concepts template constraints language extensions).

Efficient Programming with Components -- Alexander Stepanov

stepanov-components.PNGA wonderful video series by the inventor of the Standard Template Library (STL).

Video Series: Efficient Programming with Components

by Alexander Stepanov

Performance is essential for infrastructure software. Modern infrastructure software depends heavily on components. Therefore, writing performant code in this environment requires deep understanding of the characteristics of such components. The course will help programmers to improve performance of their code by learning how to use these existing generic components effectively. In addition, it will teach them to extend the library with new high-performance components. Along the way, participants will learn how to use C++ as a high-performance language.The course will be taught interactively with the class discussing, discovering, and developing components together.

Code is available here.




Scaling with C++11 -- Edouard Alligand

cppnow13-alligand.PNGFrom the recent BoostCon/C++Now event. If you missed it there, check it out online. An updated version of this talk is also slated for the upcoming Meeting C++ this fall if you want to catch it in person.

Scaling with C++11

Edouard Alligand

As the number of cores per processor increases, software needs to be able to execute multiple tasks in parallel in order to benefit from Moore's law. This is not only a question of writing parallel algorithms, but also a matter of designing the application properly to reduce inter-thread dependencies. These dependencies may be very hard to find and are the results of decades of serial programming. Thus, writing truly scalable software is less a question of technical expertise than adopting the appropriate state of mind.

This presentation is about the design, techniques and tools used by the team who wrote the hyperscalable database "quasardb." Building upon concrete scalability challenges, the presenter will expose typical multithreading anti-patterns and how to avoid them. The topics covered include: atomics, micro locks, lock-free and wait-free containers, memory management strategies (copy on write, smart pointers, perfect forwarding...), thread local storage, asynchronous I/O, and much more!

Explicit Is Better Than Implicit -- K-ballo

tales-of-cpp.PNGTales of C++, Episode 5:

Explicit Is Better Than Implicit

The Zen of Python tell us that Explicit is better than Implicit. This is good advice for any and all languages, but what are the implications in the C++ lands? There is one particular C++ feature that relates directly to that advice; one important enough that grants on its own the introduction of a keyword. That feature is user-defined conversions and that keyword is explicit.

C++ and Beyond 2013 is sold out

cb13-soldout.pngAs interest in C++ continues to increase, not only are we seeing more C++ events, but they’re selling out quickly. This spring, both the Clang/LLVM developer conference and C++ Now 2013 (formerly BoostCon) were sold out long in advance.

Today, C++ and Beyond 2013 reported it has sold out nearly six months in advance. A waitlist is available.

If you missed registering for C++ and Beyond, check out additional C++ events coming up around the world in the Upcoming Events section on the sidebar. More major C++ events in Fall 2013 will be announced shortly...

Quick Q: Am I capturing a member variable by value? -- StackOverflow

Quick A: No. You're capturing "this" by value, which is a pointer, which effectively captures members by reference.

From StackOverflow:

Lambda captures and member variables

I was watching Herb Sutter's talk at the C++ and Beyond 2012 conference on Concurrency and he talks about creating a non-blocking wrapper class, which he calls concurrent<T>, with C++11 functions.

His implementation is fairly simple (aside from needing a concurrent_queue such as that which exists in Microsoft's PPL):

template <class T>
class concurrent {
    mutable T t;
    mutable concurrent_queue<std::function<void()>> q;
    bool done = false;
    std::thread thread;

    concurrent( T t_ = T{} ) : t{t_}, thread{ [=]{ while( !done ) q.pop()(); }} {}

    ~concurrent() { q.push( [=]{ done = true; } ); thread.join(); }

    template <typename F>
    void operator()( F f ) const { q.push( [=]{ f(t); } ); }


This seems simple enough, however, I'm confused as to why he has captured the member variables done and q by value instead of by reference? My understanding is that if they are captured by value then they will be copied to the thread and thus when the queue is updated the worker thread will not receive the updates?

Have I misunderstood how lambda captures work with regards to class member variables? No one said anything in the comments to the video or during the talk so I am assuming that my understanding is faulty, in which case could someone please clarify?

LLVM 3.3 is released!

You can download either the source or prebuilt executables from the LLVM web site

Clang 3.3 includes full C++11 support, as well as a suite of run-time checkers to help find bugs in your programs.

For more information, check out the release notes for LLVM and for Clang

Meeting C++ 2013 full schedule is available

meeting-c++.PNGThe complete schedule has now been posted for the Meeting C++ conference to be held on November 8-9 in Düsseldorf, Germany.

The conference includes talks by ISO C++ standards committee members like Eric Niebler, Peter Sommearlad, Peter Gottschling, and more. Here are a just a few highlights:

  • Keynote: C++11 and No-Compromise Library Design (Eric Niebler)
  • Simpler Code through C++11 (Peter Sommerlad)
  • Scaling with C++11 (Edouard Alligand)
  • Modern C++ Network Programming (Glyn Matthews)
  • UI prototyping and development for multiple devices in C++ (John Thomas)
  • C++1y: Concepts Lite (Peter Sommerlad)

See the announcement for additional interesting talks.