This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ 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: [v3] Remove algos code duplication


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


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