Files
2025-10-25 03:02:53 +03:00

38 lines
1.5 KiB
Markdown
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[comparisons.general]
# 22 General utilities library [[utilities]](./#utilities)
## 22.10 Function objects [[function.objects]](function.objects#comparisons.general)
### 22.10.8 Comparisons [[comparisons]](comparisons#general)
#### 22.10.8.1 General [comparisons.general]
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/utilities.tex#L12260)
The library provides basic function object classes for all of the comparison
operators in the language ([[expr.rel]](expr.rel "7.6.9Relational operators"), [[expr.eq]](expr.eq "7.6.10Equality operators"))[.](#1.sentence-1)
[2](#2)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/utilities.tex#L12264)
For templates less, greater, less_equal, andgreater_equal, the specializations for any pointer type
yield a result consistent with the
implementation-defined strict total order over pointers ([[defns.order.ptr]](defns.order.ptr "3.28implementation-defined strict total order over pointers"))[.](#2.sentence-1)
[*Note [1](#note-1)*:
If a < b is well-defined
for pointers a and b of type P,
then (a < b) == less<P>()(a, b),(a > b) == greater<P>()(a, b), and so forth[.](#2.sentence-2)
— *end note*]
For template specializations less<void>, greater<void>,less_equal<void>, and greater_equal<void>,
if the call operator calls a built-in operator comparing pointers,
the call operator yields a result consistent
with the implementation-defined strict total order over pointers[.](#2.sentence-3)