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

GCC 11 Release Series

Improved.

GCC 11 Release Series

From the article:

This page is a "brief" summary of some of the huge number of improvements in GCC 11. You may also want to check out our Porting to GCC 11 page and the full GCC documentation.

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

PVS-Studio Learns What strlen is All About

Somehow, it so happens that we write about our diagnostics, but barely touch upon the subject of how we enhance the analyzer's internal mechanics. So, for a change, today we'll talk about a new useful upgrade for our data flow analysis.

PVS-Studio Learns What strlen is All About

by Andrey Karpov

From the article:

Can you see it? To be honest, we did not notice it immediately and our first thought was, "Oh no, we broke something!" Then we saw what was up and took a minute to appreciate the advantages of static analysis. PVS-Studio warned: V512 A call of the 'strcpy' function will lead to overflow of the buffer 'astr'. asm.cpp 21 Still don't see the error? Let's go through the code step by step.

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!