Articles & Books

C++ Standard Version Mix-up

Libraries compiled with different C++ standard versions might not be as compatible as wanted.

C++ Standard Version Mix-up

by Christoph Cullmann

From the article:

We work with MSVC 2019 on Windows and all worked fine with LLVM 9.x, but with master, close to all my tests did now segfault in aligned_free.

Some months ago, the implementation of DenseMap got improved to use the allocate_buffer/deallocate_buffer functions to use (if possible) aligned allocation.

Unfortunately, this means, during the compilation of the library, the checks there ensure it doesn’t use these code paths, on the other side, during compilation of our tools, it does, as the allocation functions are fully inline in the header including the feature checks.

C++ coroutines: The co_await operator and the function search algorithm--Raymond Chen

The series continue.

C++ coroutines: The co_await operator and the function search algorithm

by Raymond Chen

From the article:

So you’re following along Kenny Kerr’s blog and you get to the part where he uses co_await on a time duration:

co_await 5s;

so you try it:

#include <chrono>
using namespace std::chrono;

winrt::IAsyncAction Delay10Seconds()
{
   co_await 10s;
   co_return;
}

and you get the error message

no callable ‘await_resume’ function found for type ‘Expression’ where Expression=std::chrono::seconds

C++ coroutines: Short-circuiting suspension, part 1--Raymond Chen

The series continue.

C++ coroutines: Short-circuiting suspension, part 1

by Raymond Chen

From the article:

At the start of this series, I gave the basic idea for how the compiler generates code for co_await, but I left out some details for expository simplicity. There are some mysterious steps called “We’re not ready to talk about this step yet.”

Now it’s time to talk about one of those steps...

The Modern C++ type CoDec Challenge -- Will Wray

A meta-programming challenge in compound type destructuring

The Modern C++ type CoDec Challenge

by Will Wray

From the article:

(Assumes intermediate to advanced level C++ with some meta skills.)

Find the most effective, modern way to:  

  1. Decompose a compound type then  
  2. Represent its structure and traverse it

...

What is it?

A challenge in the spirit of Herb's GotW running ∓20 days over NY 2020:

20 days of Modern C++ ranging from 'retro' TMP to latest C++2a features,
20 days of Post Modern C++ looking ahead to an era of static reflection.

  • A personal challenge to learn about types, introspection and meta coding
  • A community challenge towards effective methods of type decomposition

...

(Let the egg hunt begin())

 

Substitution Failure is Error and Not An Error -- Milad Kahsari Alhadi

All you need to know:

Substitution Failure is Error and Not An Error

by Milad Kahsari Alhadi

From article:

I decided to write an article about the Substitution Failure issue when you write generic programs with c++ for those people who are looking for a clear and step by step introduction about it (without making everything complicated). In this article you will learn what will happen when you call a template function.