C++ Committee Meeting Trip Report: Rapperswil, 2014

The first meeting after C++14, it focused on new developments such as modules, concepts, and transactional memory, among others. This was also the first meeting the default comparisons appeared on the C++ scene.

This was my first C++ Committee Meeting, so I had quite a few eye-openers. It was hosted by the Switzerland University called HSR, which is located right next to the Rapperswil’s train station (about 30 minutes ride from Zurich).

During this meeting, no changes had been made to the C++14 standard since it had already been accepted; all work done in Rapperswil will go to C++17 and beyond.

Concepts

I spent most of the time in the Core Working Group (CWG) that reviewed the “Conepts Lite” proposal by Andrew Sutton. The proposal received tons of corrections and Andrew will come back with an updated version between meetings and more or less polished version is expected at the next meeting in Urbana. It is very likely to go into C++17.

As a side note, I was amazed by the level of attention every detail of the wording receives. For instance, it’s considered a bug to italicize the “s” in the plural form of a grammar term. For example, identifiers is bad, identifiers is good. Have you noticed the difference? Well, I didn’t. At first.

Modules

The Modules proposal presented by Gabriel Dos Reis (Microsoft) gathered a lot of attention; CWG even suspended Concepts review in order to let people attend that.

It was generally well received, but lacked a lot of concrete details. For example, modules come into play after macro substitution, but Chandler Carruth mentioned that they at Google made that attempt in clang and failed right away in the real world. As a stopgap, clang allowed macros defined on compiler’s command line to affect modules; turned out, a similar thing had been done by Microsoft as well.

It seems that Microsoft already has an implementation and are in the process of adapting legacy includes. Clang also has implemented something similar, but not directly compatible.

Transactional Memory

Transactional memory support was discussed a lot, but I did not attend the presentation. It seems to be in good enough shape (standard wording had been reviewed already) to be accepted into the standard at one of the next meetings.

I did talk to Mike Wong (who drives this effort) between sessions to discuss an idea of using transactional memory to implement lookahead in compilers. In C++, lookahead is unbounded and usually takes some effort to implement and keep up-to-date with changes in the grammar. It would’ve been useful if we could just fire up several parsers simultaneously and cancel side effects of all but one. For that, I had to ask Mike if it is possible for some info to escape a transaction rollback and he assured me that it is it.

Default comparisons

At this meeting, Oleg Smoslky presented his paper on default comparisons (N4114). The original proposal didn’t pass (this was in the Evolution Working Group, EWG), but now I know that the proposal gave a start to a great deal of discussions and follow-up papers and will be discussed for years to come.

Misc

In addition to the above, the following proposals were well received, which means they might come back in the form of an update to the standard:

  • Portable C++ ABI (N4028)
  • “restrict” modifier for C++ (N3988)
  • Parameter packs of fixed arity and direct access to N’th parameter through subscripting

At the end of the meeting, Bjarne gave a speech encouraging members of the committee to “make simple things simple” and “serve the C++ community at large”, not just experts. Apparently, he is not in favor of current direction C++ is heading when most proposals entering the committee are generalized to the point of being almost unusable in simple and most frequent cases. He used Oleg’s “Default comparisons” paper as an example of a change in the right direction that couldn’t get the committee’s approval.

References

Maxim Kartashev

Maxim Kartashev
Pragmatic, software engineer. Working for Altium Tasking on compilers and tools for embedded systems.