Articles & Books

More and More Utilities in C++20--Rainer Grimm

Small but usefull things.

More and More Utilities in C++20

by Rainer Grimm

From the article:

Today, I present a few utilities for calculating the midpoint of two values, check if a std::string starts or ends with a substring, and create callables with std::bind_front. These little utilities may not seem so little when you need them...

C++ Compile time conditional struct member variables--Saleem Ahmad

Before we get metaclasses one day?

C++ Compile time conditional struct member variables

by Saleem Ahmad

From the article:

C++ has rich set of features to do compile time calculations and optimizations to generate a better code. In one of code segment I have very large data structure in which few member variables are not used based on compile time if constexpr condition, but these variables are logged in the log line...

Range-v3: An Introduction to the Library [In Spanish] -- Daniel G Vergel

This series of posts provides a brief introduction to some of the most commonly used algorithms, views, and actions of the library. It is written entirely in Spanish, in part to mitigate the lack of educational materials on modern C++ currently available in my native language. Many of the codes are nevertheless self-explanatory, and I hope, may be of interest to a broader audience.

Ranges-v3: An Introduction to the Library

 

Range-v3: An Introduction to the Library

by Daniel G Vergel

About the series

As an Associate Professor at the European University (Madrid, Spain), I decided to integrate C++17/20 and the Range-v3 library into my teaching materials to build a more interesting and up-to-date syllabus for my courses. The adoption of a functional style of coding has helped me produce better and more expressive code, making my students' first approach to system programming easier.

  1. Examples 1 (generate_n, group_by, sort, to) and 2 (filter)
  2. Examples 3 (enumerate, shuffle, take, zip) and 4 (intersperse, tokenize)
  3. Examples 5 (getlines, transform) and 6 (iota, set_difference, split_when)
  4. Example 7 (stable_partition, subrange)
  5. Example 8 (concat, drop, generate, take_while)
  6. Examples 9 (cycle) and 10 (keys, values)

 

std::format in C++20--Peter Gottschling

More convenience for formatting.

std::format in C++20

by Peter Gottschling

From the article:

Today, I'm happy to present Peter Gottschling's guest post to the new formatting library in C++20: std::format.  Thanks to std::format, text formatting becomes in C++20 as easy as in Python...

"C++ Move Semantics - The Compete Guide" is Complete and in Print -- Nicolai Josuttis

The book "C++ Move Semantics - The Complete Guide" is now done and out as ebook or printed.

C++ Move Semantics - The Complete Guide

by Nicolai Josuttis

About the book

On 260 pages (yes, it is that complicated if you want to deal with all the details), Nicolai Josuttis introduces and explains all aspects of C++ move semantics:

  • Intuitive motivation
  • Compelling examples
  • Tricky details

The book covers all aspects of move semantics:

  • From std::move() and rvalue references
  • Over reference qualifiers, invalid moved-from states, and value categories
  • Up to tricky details in generic code using std::forward(), universal/forwarding references, auto&&, and decltype(auto).

Additional chapters about move-only types and the support of move semantics in the C++ standard library help to understand and use standard types in practice.

See cppmove.com for a detailed list of all topics covered.