Compile-time map and inverse map values
In this C++11 solution all map items are kept in constexpr array and there are constexpr recursive functions to search by either key or value. #include <utility> using Item = std::pair<int, int>; constexpr Item map_items[] = { { 6, 7 }, { 10, 12 }, { 300, 5000 }, }; constexpr auto map_size = sizeof … Read more