I have an enum class something like this:
enum Type{ First, Second, Third};
I need to map them to some values, for example:
std::map<Type, std::pair<int, float>> mp{
{First, std::make_pair(1, 8.)},
{Second, std::make_pair(5, 2.)},
{Third, std::make_pair(3, 7.)}
};
The problem with this approach is, when I want to add new values to the enum (let's say an element 'Fourth'), I have to update both the enum Type and the map. How to fix this problem?