advanced

Variant Visitation V2--Michael Park

Optimising accesses.

Variant Visitation V2

by Michael Park

From the article:

In 2015, I wrote an article titled Variant Visitation which described an implementation strategy for std::visit. The approach involved a matrix of function pointers, and many have raised concerns regarding poor code-gen caused by optimization limitations of function pointers on some compilers.

This post describes the switch-based approach implemented in mpark/variant, and its benchmark results...

C++ Weekly Episode 149: C++20's Lambda Usability Changes—Jason Turner

Episode 149 of C++ Weekly.

C++20's Lambda Usability Changes

by Jason Turner

About the show:

C++20 brings many different changes to lambdas, and two of these changes greatly affect the ways in which lambdas can be used. In this episode Jason discusses the use of lambdas in unevaluated contexts and the default constructability of lambdas in C++20.

Stop with the CTAD FUD!--Colby Pike

It's not cool.

Stop with the CTAD FUD!

by Colby Pike

From the article:

Among the catalog of features introduced by C++17, you’ll find a feature known as Class Template Argument Deduction, often shortened to “CTAD”. It was one of the largest language changes in C++17, and with it comes a new syntax and a new set of rules to understand.

It’s still very early in the game for CTAD, but we’re already seeing many strong opinions about it without seeing its widespread effect on codebases. In particular, we’re seeing a lot of Fear, Uncertainty, and Doubt about CTAD...

Deducing your intentions--Andrzej Krzemieński

Were you aware?

Deducing your intentions

by Andrzej Krzemieński

From the article:

The language feature in C++17 known as class template argument deduction was intended to supersede factory functions like make_pair, make_tuple, make_optional, as described in p0091r2. This goal has not been fully achieved and we may still need to stick to make_ functions. In this post we will briefly describe what class template argument deduction is, and why it works differently than what people often expect...