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:

Moved or Not Moved - That Is the Question!

Updated:

C++11 brought Move Semantics. Since then we have extra capabilities to write faster code, support movable-only types, but also more headaches :). At least I have, especially when trying to understand the rules related to that concept. What’s more, we also have copy elision, which is a very common optimisation (and even mandatory in several cases in C++17).

READ MORE...

Improve Multiplatform Code With __has_include and Feature Test Macros

Updated:

Two weeks ago, I showed you a sample that can detect if a function has a given overload. The example revolved around std::from_chars - low-level conversion routine for C++17. In the example, some “heavy” template patterns helped me to write the final code (most notably std::void_t and if constexpr). Maybe there are some other techniques we can use to check if a feature is available or not?

READ MORE...

Five Awesome C++ Papers for Cologne ISO Meeting

Updated:

Today is the start day of Summer C++ISO meeting, this time in Cologne, Germany! This is the “feature-complete” meeting for C++20. It’s the last time we’ll see some new elements that are merged into the working draft. Let’s see what’s already in C++20 and let’s have a look at some smaller, but very handy proposals that might get into the standard.

READ MORE...

[Quick Case] Surprising Conversions of const char* to bool

Updated:

If you have two function overloads foo(): one is taking const std::string& and the other taking bool. Which one of them will be selected when you call foo("hello world"); ? Let’s see where such a case might bite us and cause troubles? Intro   Here’s the example once again void foo(const std::string& in) { std::cout << in << '\n'; } void foo(bool in) { std::cout << "bool: " << in << '\n';} foo("Hello World"); What’s the output?

READ MORE...

Converting from Boost to std::filesystem

Updated:

As you may know std::filesystem evolved directly from Boost filesystem library. For a long time, it was available as a Technical Specification and later merged into C++17. Developers who used Boost can ask themselves what the differences between the two libs are. Can the code be easily converted to use std::filesystem?

READ MORE...

How to Iterate Through Directories in C++

Updated:

How would you implement a function that searches for files with a given extension? For example, finding all text files? or *.cpp files? To code that solution you need a way to iterate through directories. Is that possible in C++ out of the box using the standard library? Let’s see some techniques and new elements that C++17 added.

READ MORE...