Articles & Books

Five Awesome C++ Papers for the Q1 2021 and C++23 Status--Bartlomiej Filipek

c++ continues to evolve.

Five Awesome C++ Papers for the Q1 2021 and C++23 Status

by Bartlomiej Filipek

From the article:

Between 2018 and 2020, I released several articles with top 5 proposals just around a new ISO C++ meeting happened. Since March 2020, this pattern broke as the meeting went online. Why not restart the series? smile We can look at the recent papers from a whole Quarter.

Let’s start!

C++ coroutines: Allowing the awaiter to be destroyed while suspended--Raymond Chen

The series continue.

C++ coroutines: Allowing the awaiter to be destroyed while suspended

by Raymond Chen

Form the article:

One issue that we dealt with when we created our co_await awaitable signal was the case of the awaiter being destroyed while suspended. We had been ignoring that problem in our coroutine promise, but we can’t keep our head in the sand forever. Let’s take a look around and see where we are.

Pros and Cons of Alternative Function Syntax in C++--Petr Zemek

Did you think about it?

Pros and Cons of Alternative Function Syntax in C++

by Petr Zemek

From the article:

C++11 introduced an alternative syntax for writing function declarations. Instead of putting the return type before the name of the function (e.g. int func()), the new syntax allows us to write it after the parameters (e.g. auto func() -> int). This leads to a couple of questions: Why was such an alternative syntax added? Is it meant to be a replacement for the original syntax? To help you with these questions, the present blog post tries to summarize the advantages and disadvantages of this newly added syntax...

C++ coroutines: Getting rid of our reference count--Raymond Chen

The series continue.

C++ coroutines: Getting rid of our reference count

by Raymond Chen

From the article:

In an earlier installment, we simplified our promise_ptr type, and one of the consequences of this is that there are no remaining caller of increment_ref. This means that we don’t need a reference count at all and can rely on the state changes to tell us when to destroy the promise: When the awaiter has obtained the result or, or when the coroutine completes and discovers that the awaiter has abandoned its effort to obtain the result...

C++ coroutines: The lifetime of objects involved in the coroutine function--Raymond Chen

The series continue.

C++ coroutines: The lifetime of objects involved in the coroutine function

by Raymond Chen

From the article:

We finally hooked up the last missing piece of our coroutine promise implementation. Before we can look at the tradeoffs we’ve made, let’s step back and follow the lifetime of the various objects involved in the coroutine function.