[v3] Remove algos code duplication
Marc Glisse
marc.glisse@inria.fr
Sun Mar 25 22:25:00 GMT 2012
On Sun, 25 Mar 2012, Daniel KrÃŒgler wrote:
> Am 25. MÀrz 2012 22:13 schrieb Marc Glisse <marc.glisse@inria.fr>:
>> - is there anything wrong with std::less?
>
> Unfortunately yes: User-code can independently specialize std::less, so
> this could cause an observable difference. During concept time Doug
> Gregor suggested to simplify the library specification in that way, but the
> committee could not agree on that because of this observability problem.
Thank you for those precisions.
So using std::__less would be fine (a non-specializable class that
std::less derives from by default). Or std::__generic_less (with the
template parameters on the operator, not the class).
Simplifying the library this way would make sense independently from
concepts.
It is not intuitive, but I think I can begin to see why one might
specialize std::less and not want that specialization used by algorithms.
Thanks again,
--
Marc Glisse
More information about the Libstdc++
mailing list