[ub] Justification for < not being a total order on pointers?

Nevin Liber nevin at eviloverlord.com
Wed Oct 16 23:57:34 CEST 2013


On 16 October 2013 10:50, Gabriel Dos Reis <gdr at axiomatics.org> wrote:

>
> Exactly! I said std::less<std::complex<MyFloat>>, which has always been
> supposed to be user-provided, when defined.  Since C++98.


Where is the text in the standard or TR/TS (which is the only official
communication between the committee and developers) which states that?

All I can find in n3797 is 17.6.4.2.1p1: "A program may add a template
specialization
for any standard library template to namespace std only if the declaration
depends on a user-defined type
and the specialization meets the standard library requirements for the
original template and is not explicitly
prohibited."

Unless we are willing to say that std::less<T> has no requirements, I don't
see how we give permission for specializing that in a way which does not
match operator<.


>  And codes
> like that exist.


That is certainly true.  Users are clever whether or not they are on the
committee. :-)


>  The relation with your argument is that those C++98
> codes will continue to work today with C++11, while the version with
> less<void> will fail. Miresably.


Like I said, it's a long term plan...
-- 
 Nevin ":-)" Liber  <mailto:nevin at eviloverlord.com>  (847) 691-1404
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.open-std.org/pipermail/ub/attachments/20131016/e55036c1/attachment.html 


More information about the ub mailing list