Blog56K views4,601 votes1 reply1 comment587 following
Replacing Polymorphic Hierarchies with std::variant and std::visit in Modern C++
Replace classic polymorphism with C++17’s std::variant and std::visit. Learn why variants are faster, how to use them, and when they’re not the best fit.