News for hackers. Stuff that matters.
Re:C++: Associative map containers with compile-time lookup by jstimpfle on Tuesday October 23, 2018 @08:10AM (#18282647)
Look at the approach from my other comment. Requires only 1 symbol.
Re:C++: Associative map containers with compile-time lookup by hogliux on Tuesday October 23, 2018 @08:16AM (#18282671)
Both your approach and the `semi::static_map` will generate the same type of load instruction. In both cases, the compiler knows the offset of the values in memory at compile-time. The number of symbols is not really important here.