PR 57779 New debug check

Jonathan Wakely jwakely.gcc@gmail.com
Tue Jul 16 14:16:00 GMT 2013


On 15 July 2013 22:01, Paolo Carlini wrote:
> Hi,
>
> Il giorno 15/lug/2013, alle ore 13:25, François Dumont <frs.dumont@gmail.com> ha scritto:
>
>> Even if I still don't see what can goes wrong here I agree that in theory this is bad so here is another proposal that do not have this drawback. I also consider all your remarks I think except the Paolo remark about using std::greater. If I am playing with plain pointers why would I need to use std::less or std::greater ?
>
> The issue is well known, see the uses in basic_string for example, and it's about discontiguous memory, etc. The Standard explicitly discusses this case where std::less & co are specified. In short, if for a target, eg '<' doesn't make sense for arbitrary pointers,

See 5.9 [expr.rel] p2 (or p3 in the latest draft.)

> std::less does anyway (in that case an appropriate std::less shall be provided of course)

See 20.8.5 [comparisons] p8 (or 20.10.5 p14 in the latest draft.)



More information about the Libstdc++ mailing list