`std::variant` vs. inheritance vs. other ways (performance)
std::visit seems to lack some optimizations yet on some implementations. That being said there’s a central point thats not very well seen in this lab-like setup – which is that variant based design is stack based vs. the virtual inheritance pattern which will naturally gravitate towards being heap based. In a real world scenario this … Read more