Можно ли рекомендовать более элегантный способ достижения этих констант времени компиляции?
template <int> struct Map;
template <> struct Map<0> {static const int value = 4;};
template <> struct Map<1> {static const int value = 8;};
template <> struct Map<2> {static const int value = 15;};
template <int> struct MapInverse;
template <> struct MapInverse<4> {static const int value = 0;};
template <> struct MapInverse<8> {static const int value = 1;};
template <> struct MapInverse<15> {static const int value = 2;};
Значения должны быть constexpr в моей программе, но обратные отображаемые значения становятся утомительными для обновления (и легко ошибиться или забыть сделать).