on-internet
← Community

map enum values to data types

Stack Overflow ·

Is it possible to map the enum values to underlaying data types to use them with std::variant? I want to do something like the example below, but want the std::variant to understand it is an int or double. enum myValues { Int, Double }; std::variant<Int, Double> myVariant;

Comments

Sign in or sign up to comment and upvote.

No comments yet.