Tag: Cpp

2 posts with #Cpp

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