I know that compilers have much freedom in implementing std::type_info functions\' behavior. I\'m thinking about using it to compare object types, so I\'d like to be sure that:
Is there a reason why std::type_info is specified to be polymorphic? The destructor is specified to be virtual (and there\'s a comment to the effect of \"so that it\'s polymorphic\" in The Design and
I want to count all the instances of derivers from my class, I\'m trying to do it like so: .h file: #ifndef _Parant
I\'m trying to do something along these lines: int var = 5; std::numeric_limits<typeid(var)>::max();
I\'m still working on a good solution to my One-Of-A-Type Container Problem -- and upon reflection I think it would be nice to be able to just use something like a std::map<std::type_info, boost::a
I\'m fully aware that the return value of std::type_info::name() is implementation-defined. From the C++ standard (ISO/IEC 14882:2003 §18.5.1.7):
This question already has answers here: Why do I get "type has no typeinfo" error with an enum type
I know the standard answer for a linker error about missing typeinfo usually also involves vtable and some virtual function that I forgot to actually define.
Is it possible to do something along the lines of: type t = int;//this would be a function which identifies what type the next argument is
In C++ I can use typeid operator to retrieve the name of any polymorphic class: const char* name = typeid( CMyClass ).name();