Re: PR libstdc++/78420 Make std::less etc. yield total order for pointers

2018-03-22 Thread Jonathan Wakely
On 14 March 2018 at 23:01, Jonathan Wakely wrote: > Here's a very different patch. This gets rid of the __ptr_rel_ops and > just puts the special handling for pointers directly in the > std::less<_Tp*> etc. specializations. Then std::less uses > std::less for some pointer type P*. I've also added a

Re: PR libstdc++/78420 Make std::less etc. yield total order for pointers

2018-03-17 Thread Jonathan Wakely
On 14 March 2018 at 23:01, Jonathan Wakely wrote: > Here's a very different patch. This gets rid of the __ptr_rel_ops and > just puts the special handling for pointers directly in the > std::less<_Tp*> etc. specializations. Then std::less uses > std::less for some pointer type P*. I've also added a

Re: PR libstdc++/78420 Make std::less etc. yield total order for pointers

2018-03-14 Thread Jonathan Wakely
Here's a very different patch. This gets rid of the __ptr_rel_ops and just puts the special handling for pointers directly in the std::less<_Tp*> etc. specializations. Then std::less uses std::less for some pointer type P*. I've also added a ton of ugly metaprogramming to detect the "if the call op

Re: PR libstdc++/78420 Make std::less etc. yield total order for pointers

2018-03-13 Thread Jonathan Wakely
On 9 March 2018 at 00:41, Jonathan Wakely wrote: > In order to meet the total order requirements of [comparisons] p2 we > need to cast unrelated pointers to uintptr_t before comparing them. > Those casts aren't allowed in constant expressions, so only cast > when __builtin_constant_p says the resul