[patch] : Improve std::search on v7

Paolo Carlini pcarlini@suse.de
Sun Jun 19 12:06:00 GMT 2005


Chris Jefferson wrote:

> Hmm.. out of interest, could you give an example of exactly how this can
> break? I've heard of such problems with EBO, but couldn't find a
> concrete example of it breaking, and failed to do so myself (possibly a
> lack of imagination).

Yes, I would also appreciate that.

> Regardless of this however, I shall do what I should probably have done
> in the first place, which is something like:
>
> template <typename Comp, typename Val>
> struct __bind2nd
> {
>   struct trivial : private Comp
>   { Val& val; }
> ...
> };
>
> and this way there is no possibility of evil leakage.

But Comp can be an union and in that case everything breaks, I think :(

Paolo.



More information about the Libstdc++ mailing list