문제

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?).

올바른 솔루션이 없습니다

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top