std::any
Explore how to use std::any in C++17 to create flexible and type-safe containers for values of any copy-constructible type. Understand constructors, value checking, and safe retrieval of contained objects while avoiding type errors.
We'll cover the following...
We'll cover the following...
The new C++17 data types std::any, std::optional, and std::variant are all based on the Boost libraries.
std::any is a type-safe container for single values of any type which is copy-constructible. There are a few ways to create a std::any ...