Reputation: 17118
Possible Duplicate:
Can I ungarble GCC's RTTI names?
I've started using code::blocks with gcc (just couldn't stand VS2010 any more) and although I'm satisfied over all, one thing what is definitely not as well done in gcc is that when I want use typeid I'm getting not the exact type name but some symbolic notation (why? why couldn't they go with type names?) anyway, I've heard that c++filt could help with this sort of problems but I don't now how to use it (or install it - do I have to download it?).
Upvotes: 0
Views: 1534
Reputation: 791989
typeid
returns a reference to a std::type_info
instance so I presume that you are using its name()
method.
To answer your question about why you are not getting "exact" type names: name()
returns a implementation defined string so you shouldn't rely on it having any meaning. In particular, it doesn't even have to be unique to the type.
You should compare std::type_info
objects directly using ==
, !=
or .before()
, possibly incombination with .hash_code()
if you have C++11 support.
Upvotes: 2