advanced

Quick Q: How to track newer C++ std documents of given topic?

Quick A: Use wg21.link

Recently on SO:

How to track newer C++ std documents of given topic?

For the newer proposals (ones that start with the letter P) you can use wg21.link redirect service to obtain the latest document:

wg21.link - WG21 redirect service.

Usage:
wg21.link/nXXXX
wg21.link/pXXXX
wg21.link/pXXXXrX Get paper.

wg21.link/standard
Get working draft.

wg21.link/cwgXXX
wg21.link/ewgXXX
wg21.link/lwgXXX
wg21.link/lewgXXX
wg21.link/fsXXX
wg21.link/editXXX
Get issue.

wg21.link/index.json
wg21.link/index.ndjson
wg21.link/index.txt
wg21.link/specref.json
Get everything.

wg21.link/
Get usage.

For example for P0476: Bit-casting object representations if we use wg21.link/P0476 we obtain the latest version which is P0476R2.

In my answer to How does the standards committee indicate the status of a paper under consideration? I go into more details of the WG21 site and what documents you can find there.

Use the everything link for Pre P proposals
If we use the wg21 redirect service Get Everything link we can do a text search for the paper title. So for your example Improvements to std::future<T> and Related APIs we can see the last document is N3857:

"N3857": {
"type": "paper",
"title": "Improvements to std::future and Related APIs",
"subgroup": "Concurrency",
"author": "N. Gustafsson, A. Laksberg, H. Sutter, S. Mithani",
"long_link": "http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3857.pdf",
"link": "https://wg21.link/n3857",
"source": "http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/",
"date": "2014-01-16"
},

CppCon 2017: So, you inherited a large code base...--David Sankel

Have you registered for CppCon 2018 in September? Registration is open now.

While we wait for this year’s event, we’re featuring videos of some of the 100+ talks from CppCon 2017 for you to enjoy. Here is today’s feature:

So, you inherited a large code base...

by David Sankel

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

This is a talk about solving the most difficult problem a software engineer ever faces, converting a large codebase with antiquated designs and spotty quality into a state-of-the-art, modern system. We'll be covering clang-based refactoring, mnemonic reasoning methods, safe rewrites, coding standards, and, oh yes, migration paths.

If you've ever been tasked with making a legacy codebase the best-in-class, or think you might, then this talk is for you.

The Incredible Const Reference That Isn’t Const--Jonathan Boccara

To be const or not?

The Incredible Const Reference That Isn’t Const

by Jonathan Boccara

From the article:

While working on the NamedType library I came across a situation that left me stunned in bewilderment: a const reference that allows modification of the object it refers to. Without a const_cast. Without a mutable. Without anything up the sleeve.

How can this be? And how to enforce the const in that const reference?

Functions in std--Andrzej Krzemieński

The Standard reserves the right to change the signatures and overloads of the existing Standard Library functions in what is considered a backward compatible way:

Functions in std

by Andrzej Krzemieński

From the article:

Names of functions from the Standard Library used as pointers/references to functions can cause breakage in your code...

Functions of Variants are Covariant--Alfredo Correa

It's varying!

Functions of Variants are Covariant

by Alfredo Correa

From the article:

Sum types have a range of values that is the sum of the ranges of its parts. std::variant is the model representation of sum types in C++.

For example std::variant can hold an integer value (int state) or a double value (double state). The use of variant types provides support for polymorphism while maintaining value semantics.

There are only a few intrinsic functions that can be applied directly to an std::variant instance in C++; basically, only functions that probe or extract their current type state and value. Simple C++ functions over its component states cannot be applied directly to the variant since the type information needs to be probed before calling the corresponding function over the correct type.

Specific C++ functions can be applied through visitors. However, standard visitors are static and non-covariant, stopping polymorphism from propagating through function application.

A basic explanation of variants and their visitors can be found here.

Quick Q: use of constexpr in header file

Quick A: const in a header implicitely means static.

Recently on SO:

use of constexpr in header file

constexpr implies const and const on global/namespace scope implies static (internal linkage), which means that every translation unit including this header gets its own copy of PI. The memory for that static is only going to be allocated if an address or reference to it is taken, and the address is going to be different in each translation unit.

That implied static for const variables was introduced specifically to use const instead of #define in header files in C++ to define constants. Without static there would be multiple symbol definitions linker error if that header file is included in more than one translation unit which were linked together.

In C++17 you can also make it inline, so that there is only ever a single copy of PI if an address or reference to it is taken (i.e. not static). inline variables were introduced in C++17 to allow for header-only libraries with non-const variable definitions in the header files.

In other words, you should use constexpr for your constants in header files, if possible, otherwise const. And if you require the address of that constant to be the same everywhere mark it as inline.

Declarative Functional APIs – A.K.A. Abusing Lambda Parameters--Philippe Groarke

Take some time to clear your thoughts before reading!

Declarative Functional APIs – A.K.A. Abusing Lambda Parameters

by Philippe Groarke

From the article:

Functional APIs are a joy to work with. Not only do they help eliminate certain bug categories, but they tend to be very flexible and reusable. Today I present a technique that has emerged while I was simplifying some lambda based APIs. C++17 makes template meta-programming much more palatable, I dare not imagine what this would look like in C++11...