Here we explore:
- how
std::variantoffers an alternative to inheritance.
- slides about
std::variant - slides about lambda functions (for solution2)
In the file variant.cpp, replace inheritance with the use of a std::variant.
Two solutions are provided :
- with
std::get_if, - with
std::visit.