tmp/tmpq4q9amue/{from.md → to.md}
RENAMED
|
@@ -1,19 +1,19 @@
|
|
| 1 |
### Concept <a id="concept.convertible">[[concept.convertible]]</a>
|
| 2 |
|
| 3 |
-
Given types `From` and `To` and an expression `E`
|
| 4 |
-
|
| 5 |
`convertible_to<From, To>` requires `E` to be both implicitly and
|
| 6 |
explicitly convertible to type `To`. The implicit and explicit
|
| 7 |
conversions are required to produce equal results.
|
| 8 |
|
| 9 |
``` cpp
|
| 10 |
template<class From, class To>
|
| 11 |
concept convertible_to =
|
| 12 |
is_convertible_v<From, To> &&
|
| 13 |
-
requires
|
| 14 |
-
static_cast<To>(
|
| 15 |
};
|
| 16 |
```
|
| 17 |
|
| 18 |
Let `FromR` be `add_rvalue_reference_t<From>` and `test` be the invented
|
| 19 |
function:
|
|
|
|
| 1 |
### Concept <a id="concept.convertible">[[concept.convertible]]</a>
|
| 2 |
|
| 3 |
+
Given types `From` and `To` and an expression `E` whose type and value
|
| 4 |
+
category are the same as those of `declval<From>()`,
|
| 5 |
`convertible_to<From, To>` requires `E` to be both implicitly and
|
| 6 |
explicitly convertible to type `To`. The implicit and explicit
|
| 7 |
conversions are required to produce equal results.
|
| 8 |
|
| 9 |
``` cpp
|
| 10 |
template<class From, class To>
|
| 11 |
concept convertible_to =
|
| 12 |
is_convertible_v<From, To> &&
|
| 13 |
+
requires {
|
| 14 |
+
static_cast<To>(declval<From>());
|
| 15 |
};
|
| 16 |
```
|
| 17 |
|
| 18 |
Let `FromR` be `add_rvalue_reference_t<From>` and `test` be the invented
|
| 19 |
function:
|