optional in a possible C++20 future—Barry Revzin

Lots of proposals:

optional<T> in a possible C++20 future

by Barry Revzin

From the article:

C++17 gave us std::optional which is, in the words of a friend of mine, one of those really simple, ultra complex types — in the sense that it’s very easy to understand and use properly, even for relatively inexperienced programmers… but extremely difficult to implement correctly, even for experts (another such is std::pair). Today, it’s well over a thousand lines of code, most of which is critical to support even its most basic functionality. optional<T> is the simplest sum type, and it appears in lots of different languages (and even has special syntax in Swift) under various related names — Maybe, Option, etc. — but in the languages I’m even nominally familiar with, it’s about as simple to implement as it is to use.

But that’s the state of affairs today. What does tomorrow bring?

Introduction to the C++ Ranges Library—Jonathan Boccara

You can read it or watch it.

Introduction to the C++ Ranges Library

by Jonathan Boccara

From the article:

Do you know the ranges library in C++?

This video will show what limitations of the STL it solves, and how it can make C++ code more expressive.

Since some of you expressed that they liked text more than videos, I’ve included a transcript of the video. I’d be glad to know if you find this useful, and if you’d like to have a transcript for other videos...

Chaining Comparisons: Seeking Information from the Audience—Barry Revzin

A nice example of committee members reaching out to the community for data/input on proposed changes that could have a breaking impact.

Chaining Comparisons: Seeking Information from the Audience

by Barry Revzin

From the article:

At the last standards committee meeting in Albuquerque, the spaceship operator was adopted into the working draft for what will eventually be C++20. I’m already pretty excited about that. But one of the initial “optional” parts of Herb Sutter’s original spaceship proposal (which was dropped early) was to support chaining comparisons...

Red Hat at the ISO C++ Standards Meeting (Nov 2017): Parallelism and Concurrency—Torvald Riegel

Discover how C++ evolves:

Red Hat at the ISO C++ Standards Meeting (November 2017): Parallelism and Concurrency

by Torvald Riegel

From the article:

Several Red Hat engineers attended the JTC1/SC22/WG21 C++ Standards Committee meetings in November 2017. This post focuses on the sessions of SG1, the study group on parallelism and concurrency. SG1 had a full schedule as usual, with Executors, Futures, and deferred reclamation mechanisms (e.g., RCU) being major discussion topics. We also started to track the state of proposals and topics we will need to discuss in a publicly accessible bug tracker...

C++ Coroutines: Understanding operator co_await—Lewis Baker

An article very complete!

C++ Coroutines: Understanding operator co_await

by Lewis Baker

From the article:

In the previous post on Coroutine Theory I described the high-level differences between functions and coroutines but without going into any detail on syntax and semantics of coroutines as described by the C++ Coroutines TS (N4680).

The key new facility that the Coroutines TS adds to the C++ language is the ability to suspend a coroutine, allowing it to be later resumed. The mechanism the TS provides for doing this is via the new co_await operator.

Understanding how the co_await operator works can help to demystify the behaviour of coroutines and how they are suspended and resumed. In this post I will be explaining the mechanics of the co_await operator and introduce the related Awaitable and Awaiter type concepts.

But before I dive into co_await I want to give a brief overview of the Coroutines TS to provide some context...

Implementing the spaceship operator for optional—Barry Revzin

The future implementation?

Implementing the spaceship operator for optional

by Barry Revzin

From the article:

Last week, the C++ Standards Committee added operator<=>, known as the spaceship operator, to the working draft for what will eventually become C++20. This is an exciting new language feature for two reasons: it allows you to write one function to do all your comparisons where you used to have to write six, and it also allows you to write zero functions — just declare the operator as defaulted and the compiler will do all the work for you! Exciting times...