That's exactly what a tagged union does. std::variant is a tagged union. I was not aware of the name 'sum type' but it's supposed to be a synonim for a tagged union. Guess not, but std::variant is not meant as what you describe[1].
[1]: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n454...