In C++, is it possible to get the name of a type alias ?
For instance:
using my_type = some_type<a,b,c>;
std::cout << get_type_name<my_type>() << std::endl;
Would print my_type
, not some_type<a,b,c>
.
In C++, is it possible to get the name of a type alias ?
For instance:
using my_type = some_type<a,b,c>;
std::cout << get_type_name<my_type>() << std::endl;
Would print my_type
, not some_type<a,b,c>
.
No, you cannot, barring stringifying macros (which has nothing to do with type system).
There are ways to do strong typedefs, but they generate new types.
Note that the name on a typeid need not be human readable or even unique.