On Sep 16, 2025, at 04:33, Andrey Semashev via Std-Discussion <std-discussion@lists.isocpp.org> wrote:On 15 Sep 2025 16:48, David Brown via Std-Discussion wrote:
First ask yourself, is there any reason why you would want to compare
unrelated pointers for ordering?
One common use case is testing whether the pointers point to a subobject
of the same object. For example, if a pointer points within a string or
an array. This check is often needed to properly implement operations on
the string/array, such as selecting the direction of element iteration.
Really, the language already defines the logic under the name of
std::less. Why the same logic cannot be invoked as the built-in
operrator< for pointers?