Please turn JavaScript on
C++ Stories icon

C++ Stories

Subscribe in seconds and receive C++ Stories's news feed updates in your inbox, on your phone or even read them from your own news page here on follow.it.

You can select the updates using tags or topics and you can add as many websites to your feed as you like.

And the service is entirely free!

Follow C++ Stories: C++ Stories

Is this your feed? Claim it!

Publisher:  Unclaimed!
Message frequency:  0 / day

Message History

What do you do when the code for a variable initialization is complicated? Do you move it to another method or write inside the current scope?

In this blog post, I’d like to present a trick that allows computing a value for a variable, even a const variable, with a compact notation.

Updated in Jan 2026: improved code, added C++26 section, added [&] section, ...

Read full story

This article collects small, self-contained, and practical examples for working with std::chrono calendar types.

The previous blog post - see Exploring C++20 std::chrono - Calendar Types - C++ Stories - focused on the building blocks: calendar types, operato...


Read full story

Before C++20, <chrono> gave us a solid foundation for working with clocks, durations, and time points - but it didn’t really know anything about the civil calendar. If you needed to represent “March 15”, check whether a date is valid, compute “the third Monday of November”, or add a few months to a date, you had to rely on custom utilities, std::tm, or external librarie...


Read full story