I’m
looking at a lot of boilerplate code where two different enumerations are used
for the same semantic meaning, and a pair of functions (a bit switch statement)
converts one to the other.
In this
case, all the values are #define constants, not typed enumerations. But
there are lots of such pairs.
I’m
wondering if there is a simple “bi-map” class that can take a list
of pairs and produce the effect of both functions. If one of the lists of
values is consecutive it should be especially easy to initialize.
-