Runtime Polymorphism with std::variant and std::visit -- Bartlomiej Filipek

Read about an interesting way of runtime polymorphism with std::variant/std::visit!

Runtime Polymorphism with std::variant and std::visit

<img alt="" data-cke-saved-src="https://4.bp.blogspot.com/-xp784ADNQ_s/XorA74Xk8rI/AAAAAAAAESM/GFYHPA2a7_4iro82vp1IPBtFdwpLfYAZACLcBGAsYHQ/s1600/varpoly.png" src="https://4.bp.blogspot.com/-xp784ADNQ_s/XorA74Xk8rI/AAAAAAAAESM/GFYHPA2a7_4iro82vp1IPBtFdwpLfYAZACLcBGAsYHQ/s1600/varpoly.png" 200px;="" float:="" right;="" height:="" 64px;"="" style="height: 74px; width: 230px; float: right;">

by Bartlomiej Filipek

From the article:

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.

Add a Comment

You must sign in or register to add a comment.

Comments (0)

There are currently no comments on this entry.