June 16, 2020

Non-terminal variadic template parameters

A few months ago I presented a few features that I hope will be considered for C++23. I have since then submitted papers for multi-dimensional subscript expressions and ’_` as a variable placeholder. In this article I want to talk about another improvement I would like to see in the next C++ version: Non-trailing variadic template parameters. Indeed, while parameter packs can appear before the last function parameter, they do not get properly deduced when they do. Read more

April 12, 2020

To humbly present a wish-list for C++23

In Prague, the committee adopted To boldly suggest an overall plan for C++23, a paper that lays a list of priorities WG21 should focus on for C++23. The vote was almost unanimous. I voted against it. I figured it would be interesting to explain why. The problem with plans Plans have a nasty tendency to turn into deadlines and expectations. There was an uproar when contracts did not ship (even though that was the right decision), while coroutines have shipped with known issues and modules have shipped with little experience with the feature as it is in the standard. Read more

March 23, 2020

Build C++ from source: Part 1/N - Improving compile times

This is both a follow-up to my CppCon talk and the ongoing ABI saga, which I do not expect to end any time soon. I hope this article to be the first in a series I hope to write over the next few months. A quick reminder, ABI is akin to a binary protocol and decides how your types are laid out in memory, how functions are mangled and are called. Read more

March 6, 2020

A few experimental features for C++

In this article, I present a few language features that I am hoping to see in C++23 and which I have deployed to Compiler Explorer. Please note that these features are not part of a working draft and they have not been presented to the C++ committee yet, so it is impossible to comment on whether any of them might land in 23 or not! Auto Non-Static Data Members Initializers A while back I presented auto non-static data members initializers. Read more

February 25, 2020

How I use references

Following a blog post by Herb Sutter, let me tell you how and when I use references. If I do not need to mutate an input parameter, I will use a const reference, unless I know that copying is cheaper (When in doubt use a reference). If I do need a copy of the parameter, I accept it by value and move it If I do need to mutate an input parameter, I will accept an input reference. Read more

February 24, 2020

The Day The Standard Library Died

In Prague, the C++ committee took a series of polls on whether to break ABI, and decided not to. There was no applause. But I’m not sure we fully understood what we did and the consequences it could have. I do believe none of the consequences will be good. What is ABI ABI is the shared understanding libraries have about how your program is serialized, both in term of layout, calling convention and mangling. Read more

February 19, 2020

Shipping C++20 in Prague

C++20 has shipped! C++ is better and more alive than it has ever been. You might have read on the Internet (rarely a good idea), that C++ grows too fast, too complicated, too big. I do not think this is true. Bjarne Stroustrup reminded us that concepts are mentioned in Design and Evolution of C++, a book written in 1994, before even the first C++ standard. Coroutines and Modules are also old ideas that represent more than a decade of work. Read more