3 ms·
Take a look at my reply above. Your right it isn't built into the language, but it does come with a helper method, std::visit, which does take into account that
by TFortunato 6y ago
Take a look at my reply above. Your right it isn't built into the language, but it does come with a helper method, std::visit, which does take into account that you've accounted for all possible variant types, and will throw a compile error if you didn't. You also aren't stuck with if, else-if style syntax.