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 l
After a quick look at the documentation, I would say that :
std::type_info::name always returns two different strings for two different types, otherwise it means that the compiler lost itself while resolving types and you shouldn't use it anymore.
Reference tells : "before returns true if the type precedes the type of rhs in the collation order. The collation order is just an internal order kept by a particular implementation and is not necessarily related to inheritance relations or declaring order." You therefore have the guarantee that no types has the same rank in the collation order.
Each instantiation of a template class is a different type. Specialization make no exceptions.
I don't really understand what you mean. If you mean something like having typedef foo bar;
in two separate compilation units and that bar is the same in both, it works that way. If you mean typedef foo bar; typedef int bar;
, it doesn't work (except if foo is int).
About your other questions :
operator==
instead of make it virtual and override it.