Reputation: 2458
For debugging purposes, I want to print the values of template parameters.
For type template parameters, I can use typeid(T).name()
, which gives me (more or less) the name of the type T
as a string.
Is there a way to get a similar string (e.g. "&Parent::member
") for a pointer-to-member template parameter? I cannot use typeid
here, because the pointer is not a type.
The debugging string shall contain the name of the member as well as the type name of the parent.
Upvotes: 1
Views: 162
Reputation: 29962
Variable/member names don't get written into the compiled objects files by default. So this information is lost during the compilation process, you cannot get it. The only exception is if you compile with debug information, but even this case, debug information is not loaded with your exe when you execute it.
I see two possible solutions:
Upvotes: 1