Favourite C++ features


  • Boost filesystem
  • execution policy: parallel algorithm support for range-based for loops - potential for easily parallelsing existing code
  • structured bindings
  • clamp
  • std::optional
  • [[maybe_unused]]



  • Concepts are a revolutionary approach for writing templates! They allow you to put constraints on template parameters that improve the readability of code, speed up compilation time, and give better error messages.

C++20 gives us language support (new keywords - requires, concept) and a set of predefined concepts from the Standard Library.

In other words, you can restrict template parameters with a “natural” and easy syntax. Before C++20, there were various ways to add such constraints. See my other post Simplify Code with if constexpr and Concepts in C++17/C++20 - C++ Stories.


template <typename T>
void print(const std::vector<T>& vec) {
for (size_t i = 0; auto& elem : vec)
std::cout << elem << (++i == vec.size() ? "n" : ", ");
void print2(const std::vector<auto>& vec) {
for (size_t i = 0; auto& elem : vec)
std::cout << elem << (++i == vec.size() ? "n" : ", ");

Ranges and views

The ranges library provides components for dealing with ranges of elements, including a variety of view adapters: immutable views of things; a nod to strongly typed, const languages like Haskell, composing syntax.


A new stackless threading model that also allows lazy evaluation of infinite sequences.


Wish list

See the compiler support matrix.

  • std::format
  • modules - wait for clang12, gcc11


Look interesting but not available until clang-12.

results matching ""

    No results matching ""