i want to find out the type of a Variable (the variable is given by a Template parameter, so I don’t know what it is).
#include <iostream>
#include <typeinfo>
int main()
{
double test;
std::cout << typeid(test).name() << std::endl;
}
But the Code only emits:
$./test
d
but I would need double instead.
The point is, I don’t know which type to expect, but I have to write it in a subprogram, which hast to be compiled. So d is a bad idea.
In GNU ABI, there is a helper to demangle the
name()of atypeid