January 2018
Intermediate to advanced
374 pages
9h 53m
English
In contrast to std::optional and std::variant (std::variant is discussed in Chapter 8, Meta programming and Compile-Time evaluation), std::any heap-allocates its withheld value (although implementers are encouraged to store small objects inside of the any). Also, invoking a std::any_cast to retrieve the value is quite slow compared to std::variant.