Tag: Cpp

3 posts with #Cpp

Why std::expected matters for error handling

Why std::expected matters for error handling C++23 introduced std::expected, changing how we handle errors without exceptions. When you combine it with std::error_code (available since C++11), you get an error handling approach that forces explicit error checks while keeping your code readable. The...

Published Wed, 17 Dec 2025

Practical cppstd 17 highlights by example

Practical cppstd 17 highlights by example Language Features Library Features Language Features Nested namespace definitions namespace A::B::C { // ... } // Rather than: namespace A { namespace B { namespace C { // ... } } } Structured bindings #include <map> #include <string> #include...

Published Mon, 06 Mar 2023

Create an array of all possible variants alternatives of std::variant type

The standard library std::variant is a usefull feature, introduced since c++17, to define a type that can hold multiple alternative types. For example a cell of a CSV file could represent multiple data types such as a string or int. Declaring a new type std::variant<std::string, int> allows to...

Published Thu, 02 Mar 2023