About This Website

C++ By Example is written and produced by Rob Cusimano.

photo of the author

Essential Tools

The C++ Standard and This Website

Generally, examples on this website use the second most recent C++ Standard. That means today in 2021 most examples use C++17 because the most recent C++ Standard is C++20. In 2023, when C++23 is released, you will start seeing new examples with C++20 features and older examples being updated to take advantage of new features when it is appropriate. There’s two reasons for this:

  1. C++ has changed a lot over time. C++ examples written for C++11 (or even C++98) compatibilty look very different than examples written today. This isn’t very useful when all major compilers today support C++17.
  2. Speaking of compiler support, C++ compiler developers need time to implement the latest standards. It’s unlikely your compiler supports all the latest standard’s features. Writing code examples about a new standard isn’t very interesting when there’s no way to run them.

All that said, if major compilers do support a given feature and it’s of interest to the readers of this website, examples will be written demonstrating that feature (I’m looking at you std::format). Pay close attention to the tags of each example (such as c++17) for the standard of C++ the example uses.

All examples compiled with the -Wall -Werror options and the sample’s tagged standard.


For more C++ By Example, click here.