Would you please help me getting back the typename of the original object put into a boost::variant?
I have something like this
typedef boost::variant<macro,module> ref_var;
Is it possible to get back the typename of the original object? In this case (macro or module)
I was trying to get it using
typeid(v).name()
but it gives me weird name that is neither macro nor module:
PN5boost7variantI5macro6moduleNS_6detail7variant5void_ES5_S5_S5_S5_S5_S5_S5_S5_S5_S5_S5_S5_S5_S5_S5_S5_S5_EE
Would you please help?
If all you need is to get back the textual representation of the types held in a variant, you can roll your own solution: