PR 57779 New debug check
Paolo Carlini
paolo.carlini@oracle.com
Mon Jul 15 21:02:00 GMT 2013
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, std::less does anyway (in that case an appropriate std::less shall be provided of course)
Paolo
More information about the Libstdc++
mailing list