Runtime polymorphism usually connects with v-tables and virtual functions. However, in this blog post, I’ll show you a modern C++ technique that leverages std::variant
and std::visit
. This C++17 technique might not only offer better performance and value semantics, but also interesting design patterns.
↧
Runtime Polymorphism with std::variant and std::visit
↧