This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: RFC: change in std::type_info's equality operator
- From: "Paolo Bonzini" <bonzini at gnu dot org>
- To: "GCC Development" <gcc at gcc dot gnu dot org>
- Cc: <austern at apple dot com>
- Date: Sun, 15 Feb 2004 13:18:42 +0100
- Subject: Re: RFC: change in std::type_info's equality operator
> (2) t1.__name == t2.__name || strcmp(t1.__name, t2.__name) == 0.
>
> The library uses version (1) iff the compiler defines __GXX_WEAK__
> to be true.
>
> My proposal: change the library so it unconditionally uses version 2.
> That is, always fall back to string comparison if the address comparison
>
> The disadvantage: it hurts the performance of anything that uses
> typeinfo comparison where negative comparisons are common.
Would it be possible to store an hash code together with the name and
compare it before the string? Would it break the ABI?
Paolo