In C++ is it possible to generate a compile time map of stringified type names to types. I am aware types themselves can’t be mapped but could we for example map to template metafunctions which expose a type?
So specifically could we for example have one varadic template metafunction which takes some initial set of types, then at compile time constructs a static map using a fold expression for example such that at runtime we could access an exposed type and use it as a template parameter to another function, something like this
TypeMapper::Map["Type1"]::type
So then at runtime if we wanted to for example execute a specific templated function we could do
MyTypeProcessor<TypeMapper::Map["Type1"]::type>();
If this is not possible due to limitations in the language I am curious as to what limitation specifically, because individually I believe the individual parts of the idea are somewhat feasible but I’m just unsure how, so if I’m missing something here any assistance would be greatly appreciated. I am still somewhat new to stuff so I could be misunderstanding some things.