How to Use std::visit With Multiple Variants

std::visit is a powerful utility that allows you to call a function over a currently active type in std::variant. It does some magic to select the proper overload, and what’s more, it can support many variants at once.
Let’s have a look at a few examples of how to use this functionality.

Link: https://dzone.com/articles/how-to-use-stdvisit-with-multiple-variants?utm_medium=feed&utm_source=feedpress.me&utm_campaign=Feed%3A+dzone%2Fwebdev