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
Type_info is implementation defined so I really wouldn't rely on it. However, based on my experiences using g++ and MSVC, assumptions 1,3 and 4 hold... not really sure about #2.
Is there any reason you can't use another method like this?
template
struct is_same { static bool const result = false; };
template
struct is_same { static bool const result = true; };
template
bool IsSame(const S& s, const T& t) { return is_same::result; }