Articles & Books

Class Templates--Rainer Grimm

The series continue.

Class Templates

by Rainer Grimm

From the article:

A function template represents a family of functions. Accordingly, a class template represents a family of classes. Today, I want to introduce class templates...

Function Templates - More Details about Explicit Template Arguments and Concepts--Rainer Grimm

The series continue.

Function Templates - More Details about Explicit Template Arguments and Concepts

by Rainer Grimm

From the article:

In the last post "Function Templates", I wrote about the overloading of function templates and automatically deducing the return type of a function template. Today, I dive deeper and specify explicitly the template arguments of a function template and bring concepts into the play...

A Default Value to Dereference Null Pointers--Jonathan Boccara

Adding more readability.

A Default Value to Dereference Null Pointers

by Jonathan Boccara

From the article:

With C++17, modern C++ has acquired a nullable object: std::optional. optional has a pretty rich interface, in particular when it comes to handling null optionals.

On the other hand, the oldest nullable type in C++, pointers, doesn’t have any helper to make the handling of its nullity more expressive.

Let’s see what we can do about it, to make our code using pointers, smart or raw, easier to read...

C++20 Coroutine: Under The Hood--Vishal Chovatiya

Know how they work.

C++20 Coroutine: Under The Hood

by Vishal Chovatiya

From the article:

A coroutine is one of the major feature introduced with the C++20 standard apart from Module, Ranges & Concept. And you see how happy I am to unfold it. I already set the baseline on this topic with my previous article that Coroutine in C Language, where we saw, how suspension-resumption of execution works! With this article “C++20 Coroutine: Under The Hood”, we will see how compiler creates magic & standard library helps it with basic infrastructure making C++20 coroutine more sophisticated(yet complex) & scalable/customizable...

Report from the virtual ISO C++ meetings in 2020 (core language)--Jason Merrill

Did you attend?

Report from the virtual ISO C++ meetings in 2020 (core language)

by Jason Merrill

From the article:

C++ standardization was dramatically different in 2020 from earlier years. The business of the International Organization for Standardization (ISO) committee all took place virtually, much like everything else during this pandemic. This article summarizes the C++ standardization proposals before the Core and Evolution Working Groups last year...

Coroutines series--Raymond Chen

The series continue.

C++ coroutines: Promise constructors

From the article:

So far, all of our coroutine promises have had only a default constructor. But the standard actually gives the promise access to the coroutine parameters, if it wants them...

A map through the three major coroutine series

From the article:

Our long national nightmare is not yet over: The three main coroutine series are now done, although that doesn’t mean I’m done with coroutines.

Here’s a map through the main series, at least. There is a direct route and a number of scenic routes...

A subtle way your await_suspend can access the coroutine frame when it shouldn’t

From the article:

As we learned in the very start of the series on coroutines, the await_suspend method cannot access the coroutine frame once it arranges for the coroutine to resume because that creates a race condition where the coroutine might already be resumed and possibly even run to completion before await_suspend finishes...

by Raymond Chen