The C++ Stories Weekly Newsletter

Join ~11000 developers who read about Modern C++, news reports, tools, and more! A new email every Monday.
Bonuses included! C++23/C++20/C++17 ref cards and more!

The above field is supplemented with consent to receive a newsletter containing information and marketing content about the cppstories.com portal from Bartłomiej Filipek codebf based in Krakow. The consent may be withdrawn at any time. See the full Privacy Policy.


See the latest articles:

Five Advanced Initialization Techniques in C++: From reserve() to piecewise_construct and More.

Updated:

From dynamic container operations to compile-time constants, C++ offers a variety of techniques (as in this famous Meme :)). In this article, we’ll delve into advanced initialization methods likereserve() and emplace_backfor containers to tuples with piecewise_construct and forward_as_tuple. Thanks to those techniques, we can reduce the number of temporary objects and create variables more efficiently.

READ MORE...

Finite State Machine with std::variant

Updated:

In this blog post, I’ll show you how to convert a “regular” enum-style finite state machine into a modern version based on std::variant from C++17. This technique allows you to improve design, work with value types and enhance code quality. States   Let’s start with a basic example: we want to track a game player’s health status we’d like to respond to events like “Hit by a monster” or “Healing bonus.

READ MORE...

Storage duration and Non-local Objects in C++

Updated:

C++ allows us to declare various forms of non-local objects: they usually live throughout the execution of the whole program. In this article, we’ll look at global variables, dynamic, and thread-local objects. We’ll also consider new features for safe initialization C++20. This text comes from my book “C++ Initialization Story”.

READ MORE...

Q&A - C++ Initialization

Updated:

Last time I showed a couple of questions about initialization. Try them here if you haven’t already. In this article, I’ll show you the answers and add more notes about initialization in C++. About   I selected the following questions from 25 questions that you can find in my C++ Initialization Story book:

READ MORE...

C++ Initialization Quiz

Updated:

Do you know the answers to those ten questions about Initialization in Modern C++? About   I selected the following questions from 25 questions that you can find in my C++ Initialization Story book: Print version @Amazon C++ Initialization Story @Leanpub Moreover, in the book, you can find a few coding exercises to practice skills.

READ MORE...

C++ Initialization Story in Print

Updated:

I’m thrilled to announce the print/paperback edition of “C++ Initialization Story!” After nearly a year of updates and enhancements for the electronic version, this comprehensive resource is now complete! You can purchase the book in a variety of formats, and to celebrate this major update, I’m hosting a giveaway where you can get the book for free :)

READ MORE...