January 2018
Intermediate to advanced
374 pages
9h 53m
English
Now that we have the boilerplate for a heterogeneous container of dynamic size, let's see how we can use it like a regular std::vector:
using VariantType = std::variant<int, std::string, bool>;
auto c = std::vector<VariantType> { 42, std::string{"needle"}, true };
Read now
Unlock full access