Here is a typical implementation of type_info::operator==
:
#if _PLATFORM_SUPPORTS_UNIQUE_TYPEINFO
bool operator==(const type_info& __rhs) const {
return __mangled_name == __rhs.__mangled_name;
}
#else
bool operator==(const type_info& __rhs) const {
return __mangled_name == __rhs.__mangled_name ||
strcmp(__mangled_name, __rhs.__mangled_name) == 0;
}
#endif
In libstdc++ it's controlled with __GXX_MERGED_TYPEINFO_NAMES
,
in libc++ it's _LIBCPP_NONUNIQUE_RTTI_BIT
,
MSVC always compares strings.
What are the platforms which don't compare strings?