Is there a canonical/reference implementation of a compile time map, which maps types to types?
For example, I would need a type mapping from IBar -> IFoo or from int -> IFoo.
At compile time I can then select IFoo when given a IBar.
How would one go about this with C++17?
Edit: here is an example using structs https://godbolt.org/z/EEvrYd9PE
You could define one with overloading and return types. This will act like a map data structure that you can initialize and reuse with many types for many purposes.
You can use it like this:
Live example
It should be quite fast as the lookup is limited to the scope of the class only, and uses the compilers own overload resolution.