This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] : Improve std::search on v7


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]