tmp/tmpiuw6yvyi/{from.md → to.md}
RENAMED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
### Concept <a id="concept.commonref">[[concept.commonref]]</a>
|
| 2 |
+
|
| 3 |
+
For two types `T` and `U`, if `common_reference_t<T, U>` is well-formed
|
| 4 |
+
and denotes a type `C` such that both `convertible_to<T, C>` and
|
| 5 |
+
`convertible_to<U, C>` are modeled, then `T` and `U` share a *common
|
| 6 |
+
reference type*, `C`.
|
| 7 |
+
|
| 8 |
+
[*Note 1*: `C` could be the same as `T`, or `U`, or it could be a
|
| 9 |
+
different type. `C` may be a reference type. — *end note*]
|
| 10 |
+
|
| 11 |
+
``` cpp
|
| 12 |
+
template<class T, class U>
|
| 13 |
+
concept common_reference_with =
|
| 14 |
+
same_as<common_reference_t<T, U>, common_reference_t<U, T>> &&
|
| 15 |
+
convertible_to<T, common_reference_t<T, U>> &&
|
| 16 |
+
convertible_to<U, common_reference_t<T, U>>;
|
| 17 |
+
```
|
| 18 |
+
|
| 19 |
+
Let `C` be `common_reference_t<T, U>`. Let `t1` and `t2` be
|
| 20 |
+
equality-preserving expressions [[concepts.equality]] such that
|
| 21 |
+
`decltype((t1))` and `decltype((t2))` are each `T`, and let `u1` and
|
| 22 |
+
`u2` be equality-preserving expressions such that `decltype((u1))` and
|
| 23 |
+
`decltype((u2))` are each `U`. `T` and `U` model
|
| 24 |
+
`common_reference_with<T, U>` only if:
|
| 25 |
+
|
| 26 |
+
- `C(t1)` equals `C(t2)` if and only if `t1` equals `t2`, and
|
| 27 |
+
- `C(u1)` equals `C(u2)` if and only if `u1` equals `u2`.
|
| 28 |
+
|
| 29 |
+
[*Note 1*: Users can customize the behavior of `common_reference_with`
|
| 30 |
+
by specializing the `basic_common_reference` class
|
| 31 |
+
template [[meta.trans.other]]. — *end note*]
|
| 32 |
+
|