Articles & Books

Chinese translation: "Thriving in a crowded and changing world: C++ 2006-2020" -- Bjarne Stroustrup

Thanks to the Chinese C++ experts who did this translation of Bjarne Stroustrup's latest History of Programming Languages paper! That's a massive job, and translations of technical papers are very rare in our field.

Bjarne Stroustrup: Thriving in a crowded and changing world: C++ 2006-2020

English (Jun 2020)

Chinese (Oct 2021)

See also: Pre-recording and Q&A

ACM/SIGPLAN History of Programming Languages conference, HOPL-IV. London. June 2020.

All the HOPL-4 papers are posted as Proceedings of the ACM on Programming Languages Vol. 4.

Dependent Names--Rainer Grimm

The series continue.

Dependent Names

by Rainer Grimm

From the articles:

A dependent name is essentially a name that depends on a template parameter. A dependent name can be a type, a non-type, or a template parameter. To express that a dependent name stands for a type or a template, you have to use the keywords typename or template...

Compiler Explorer with Cmake--Gajendra Gulgulia

New capabilities.

Compiler Explorer with Cmake

by Gajendra Gulgulia

From the article:

Compiler explorer has been one of the most widely used online tool for compiling C++ code, doing experiment with C++ features, sharing code snippets with friends and colleagues and also (my favorite feature) to compare and prove with the help of assembly code why a certain way of coding might be good or bad compared to another way.
Recently compiler explorer added support for compiling multiple files with CMakeLists.txt [1] . This opens up a new possibilities for developers around the world from testing complex pieces of code to testing the compilation behavior of the same.
In this issue, I would like to give a walk through on how to set up a simple layout of three files compiled with CMakelists.txt. Note that the focus is on setting up compiler explorer for multiple files and not on code efficiency. Also the article might at first glance look lengthy, but it may only be due to 19 images in the tutorial. So don’t get weighed down by the size of the article and lets start!

A Recap on User Defined Literals--Jonathan Boccara

Are you using them?

A Recap on User Defined Literals

by Jonathan Boccara

From the article:

User defined literals were introduced in C++11, evolved in C++14 and C++17, and are a nice way to write more expressive code.

The general idea behind user defined literals is that they allow to write a value and tack on a term describing what this value represents. For example:

auto const quantity = 42_bottles_of_water;

In this expression, 42 is the value and _bottles_of_water is the user defined suffix. The expression as a whole is a user defined literal.

A common usage of user defined literals is to represent units, but they can also be used to add meaning to values in more general contexts.

Here is how to write user defined literals in C++11, C++14 and C++17...

C++20 Coroutines — Complete* Guide--Šimon Tóth

Learn to use them.

C++20 Coroutines — Complete* Guide

by Šimon Tóth

From the article:

C++20 brought us initial support for coroutines. In this article, we will go over several examples of coroutines that build upon each other. Word of warning, though, the support in C++20 is mainly targeted at library implementors. C++23 should be bringing additional support that should cover at least the most common use cases...

C++20 Coroutine Iterators--Martin Bond

The series continue.

C++20 Coroutine Iterators

by Martin Bond

From the article:

In my first blog post about C++20 Coroutines I introduced the concepts behind a synchronous or generator style coroutine and developed a template class to support coroutines for any data type.

In this post I’ll add an iterator to the template to support the range-for loop and iterative algorithms. You may want to review that post before reading this one but the following code should act as a reminder about how to write and use a coroutine to read two floating point values into a data structure for subsequent analysis...