Articles & Books

The surprisingly high cost of static-lifetime constructors--Arthur O’Dwyer

Today we look at compile time performance.

The surprisingly high cost of static-lifetime constructors

by Arthur O’Dwyer

From the article:

I was looking at HyperRogue again this week (see my previous post). It has a really nice localization framework: every message in the game can be translated just by adding a lookup entry to a single file (like, for the Czech translation, you add entries to language-cz.cpp); and then during the build process, all the language-??.cpp files are collated together and used to produce a single language-data.cpp file with a lookup table from each English message to the same message in every other language. (Seeing all the messages at once allows us to report on how “complete” each translation is, relative to the others.)...

 

The Tightly-constrained Design Space of Convenient Syntaxes For Generic Programming --Corentin Jabot

An exploration of the various convenient syntaxes for declaring templates and function templates as proposed C++20:

The tightly-constrained design space of convenient syntaxes for generic programming

by Corentin Jabot

About the article:

Did you know that the Concept TS was merged into the Working Draft in July 2017, in Toronto? And we are a Planck length away from merging the Range TS in C++20 as well, including a few goodies such as projections, contiguous ranges/iterators and ranges adaptors? We also added a bunch of general-purpose concepts in the std namespace in Rapperswil.

Concepts have been 3 decades in the making and the Ranges TS is a huge body of work. Yet, I feel like a lot of people are unaware of these great features that are coming to a compiler near them.

Examples of Parallel Algorithms From C++17--Bartlomiej Filipek

Do you know them?

Examples of Parallel Algorithms From C++17

by Bartlomiej Filipek

From the article:

MSVC (VS 2017 15.7, end of June 2018) is as far as I know the only major compiler/STL implementation that has parallel algorithms. Not everything is done, but you can use a lot of algorithms and apply std::execution::par on them!

Have a look at few examples I managed to run...

Modern C++ for C programmers -- bert hubert

In 2018, C++ is a modern programming language that C programmers may want to take another look at, especially if they are pondering shifting to Go or Rust.

Modern C++ for C programmers part 1

Modern C++ for C programmers part 2

by Bert Hubert

From the article:

In this and subsequent posts, I hope to convince C programmers to give ‘2017 era C++’ (which is entirely unlike 2003 C++) another good look. To do so, I want to show that within C++ hides a simple language that still offers you many good things without immediately requiring you to tackle all 1400 pages of ‘The C++ Programming Language’. In other words, I claim there is great benefit already when only using a judicious selection of the best parts of C++.

My goal is that when you go look for a new language to learn (say, Go or Rust), you will hopefully consider modern C++ as well

 

C++17: Attributes--Marc Gregoire

Another new feature.

C++17: Attributes

by Marc Gregoire

From the article:

C++17 introduces three new code attributes:

  • [[fallthrough]]
  • [[maybe_unused]]
  • [[nodiscard]]

The first one was discussed in detail in my C++17: Fallthrough in switch statements blog post. The others are briefly explains below...

C++ rvalue references and move semantics for beginners

A collection of personal notes and thoughts on rvalue references, their role in move semantics and how they can significantly increase the performance of your applications.

C++ rvalue references and move semantics for beginners

by Triangles @ internalpointers.com

From the article:

In my previous article Understanding the meaning of lvalues and rvalues in C++ I had the chance to explain to myself the logic behind rvalues. The core idea is that in C++ you will find such temporary, short-lived values that you cannot alter in any way.

Surprisingly, modern C++ (C++0x and greater) has introduced rvalue references: a new type that can bind to temporary objects, giving you the ability to modify them. Why?