This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] : Improve std::search on v7
Gabriel Dos Reis wrote:
>| You said there are problems with virtuals. Ok, let's deal with that in a
>| radical way: we check whether the base class at issue, Compare, is
>| *really* empty, tr1::is_empty is false in case of virtuals, and only in
>| those safe cases, we *derive* from it and exploit EBO.
>
>At this point, I'll wait to see the concrete codes before I do any further
>comment.
>
As I said, there is no point in working out those details, because we
don't know how to deal with unions. Would be something very
straighforward, already dozens of examples of the basic idea in
stl_algobase.h, recently in sso_string.h. Only we would dispatch to two
specializations basing on is_empty<_Comp>, in one case have _Comp as a
base, in the other one have it as the type of a member, like in Chris'
original proposal for the __fun member:
http://gcc.gnu.org/ml/libstdc++/2005-03/msg00053.html
Paolo.