tmp/tmplqj6pnyf/{from.md → to.md}
RENAMED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
### Comparison common types <a id="concept.comparisoncommontype">[[concept.comparisoncommontype]]</a>
|
| 2 |
+
|
| 3 |
+
``` cpp
|
| 4 |
+
template<class T, class U, class C = common_reference_t<const T&, const U&>>
|
| 5 |
+
concept comparison-common-type-with-impl = // exposition only
|
| 6 |
+
same_as<common_reference_t<const T&, const U&>,
|
| 7 |
+
common_reference_t<const U&, const T&>> &&
|
| 8 |
+
requires {
|
| 9 |
+
requires convertible_to<const T&, const C&> || convertible_to<T, const C&>;
|
| 10 |
+
requires convertible_to<const U&, const C&> || convertible_to<U, const C&>;
|
| 11 |
+
};
|
| 12 |
+
|
| 13 |
+
template<class T, class U>
|
| 14 |
+
concept comparison-common-type-with = // exposition only
|
| 15 |
+
comparison-common-type-with-impl<remove_cvref_t<T>, remove_cvref_t<U>>;
|
| 16 |
+
```
|
| 17 |
+
|
| 18 |
+
Let `C` be `common_reference_t<const T&, const U&>`. Let `t1` and `t2`
|
| 19 |
+
be equality-preserving expressions that are lvalues of type
|
| 20 |
+
`remove_cvref_t<T>`, and let `u1` and `u2` be equality-preserving
|
| 21 |
+
expressions that are lvalues of type `remove_cvref_t<U>`. `T` and `U`
|
| 22 |
+
model `comparison-common-type-with<T, U>` only if:
|
| 23 |
+
|
| 24 |
+
- `CONVERT_TO_LVALUE<C>(t1)` equals `CONVERT_TO_LVALUE<C>(t2)` if and
|
| 25 |
+
only if `t1` equals `t2`, and
|
| 26 |
+
- `CONVERT_TO_LVALUE<C>(u1)` equals `CONVERT_TO_LVALUE<C>(u2)` if and
|
| 27 |
+
only if `u1` equals `u2`
|
| 28 |
+
|