Articles & Books

The most popular C++ standard features

The next article on the results from the Meeting C++ survey

The most popular C++ standard features

by Jens Weller

From the article:

Continuing the series about the Meeting C++ survey results with a look at the standard features. Last week I compared the ISOCPP survey to the one of Meeting C++.

When I was looking into the questions I could ask in the survey tool, it came to my mind that it would be interesting to know more about the details of standards, not just asking for which standard folks use in various ways. So in this blog post, I'm going to show you the questions about standard feature usage.

C++ coroutines: How do I create a coroutine that terminates on an unhandled exception?--Raymond Chen

The series continue.

C++ coroutines: How do I create a coroutine that terminates on an unhandled exception?

by Raymond Chen

From the article:

Last time, we saw that declaring a coroutine as noexcept doesn’t do what you think. The noexcept specific says that production of the coroutine does not throw an exception, but it says nothing about what happens during execution of the coroutine. If an exception occurs inside the coroutine, the promise’s unhandled_exception method decides what happens...

C++ coroutines: What does it mean when I declare my coroutine as noexcept?--Raymond Chen

The series continue.

C++ coroutines: What does it mean when I declare my coroutine as noexcept?

by Raymond Chen

From the article:

Suppose you want a coroutine that terminates on unhandled exceptions, or equivalently (looking at it from the consumer side) a coroutine that never throws an exception when awaited. For regular functions, the way to say this is to put the noexcept exception specification on your function declaration...

C++ coroutines: Improving cold-start coroutines which complete synchronously--Raymond Chen

The series continue.

C++ coroutines: Improving cold-start coroutines which complete synchronously

by Raymond Chen

From the article:

Last time, we learned that the naïve implementation of cold-start coroutines is susceptible to stack build-up. What we want is for await_suspend to return false if the coroutine completed synchronously. This is tricky because that reintroduces a race condition where the coroutine runs asynchronously and completes at the same time we try to transition from synchronous to asynchronous behavior in the awaiter...

C++ coroutines: Cold-start coroutines--Raymond Chen

The series continue.

C++ coroutines: Cold-start coroutines

by Raymond Chen

From the article:

So far, our coroutine promise has implemented a so-called hot-start coroutine, which is one that begins running as soon as it is created. Another model for coroutines is the so-called cold-start coroutine, which is one that doesn’t start running until it is awaited...

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...