tmp/tmpb0zl0v_v/{from.md → to.md}
RENAMED
|
@@ -0,0 +1,124 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
##### Constructors and assignment operators <a id="func.wrap.ref.ctor">[[func.wrap.ref.ctor]]</a>
|
| 2 |
+
|
| 3 |
+
``` cpp
|
| 4 |
+
template<class... T>
|
| 5 |
+
static constexpr bool is-invocable-using = see below;
|
| 6 |
+
```
|
| 7 |
+
|
| 8 |
+
If *noex* is `true`, *`is-invocable-using`*`<T...>` is equal to:
|
| 9 |
+
|
| 10 |
+
``` cpp
|
| 11 |
+
is_nothrow_invocable_r_v<R, T..., ArgTypes...>
|
| 12 |
+
```
|
| 13 |
+
|
| 14 |
+
Otherwise, *`is-invocable-using`*`<T...>` is equal to:
|
| 15 |
+
|
| 16 |
+
``` cpp
|
| 17 |
+
is_invocable_r_v<R, T..., ArgTypes...>
|
| 18 |
+
```
|
| 19 |
+
|
| 20 |
+
``` cpp
|
| 21 |
+
template<class F> function_ref(F* f) noexcept;
|
| 22 |
+
```
|
| 23 |
+
|
| 24 |
+
*Constraints:*
|
| 25 |
+
|
| 26 |
+
- `is_function_v<F>` is `true`, and
|
| 27 |
+
- *`is-invocable-using`*`<F>` is `true`.
|
| 28 |
+
|
| 29 |
+
*Preconditions:* `f` is not a null pointer.
|
| 30 |
+
|
| 31 |
+
*Effects:* Initializes *bound-entity* with `f`, and *thunk-ptr* with the
|
| 32 |
+
address of a function *`thunk`* such that
|
| 33 |
+
*`thunk`*`(`*`bound-entity`*`, `*`call-args`*`...)` is
|
| 34 |
+
expression-equivalent [[defns.expression.equivalent]] to
|
| 35 |
+
`invoke_r<R>(f, `*`call-args`*`...)`.
|
| 36 |
+
|
| 37 |
+
``` cpp
|
| 38 |
+
template<class F> constexpr function_ref(F&& f) noexcept;
|
| 39 |
+
```
|
| 40 |
+
|
| 41 |
+
Let `T` be `remove_reference_t<F>`.
|
| 42 |
+
|
| 43 |
+
*Constraints:*
|
| 44 |
+
|
| 45 |
+
- `remove_cvref_t<F>` is not the same type as `function_ref`,
|
| 46 |
+
- `is_member_pointer_v<T>` is `false`, and
|
| 47 |
+
- *`is-invocable-using`*`<cv T&>` is `true`.
|
| 48 |
+
|
| 49 |
+
*Effects:* Initializes *bound-entity* with `addressof(f)`, and
|
| 50 |
+
*thunk-ptr* with the address of a function *`thunk`* such that
|
| 51 |
+
*`thunk`*`(`*`bound-entity`*`, `*`call-args`*`...)` is
|
| 52 |
+
expression-equivalent [[defns.expression.equivalent]] to
|
| 53 |
+
`invoke_r<R>(static_cast<cv T&>(f), `*`call-args`*`...)`.
|
| 54 |
+
|
| 55 |
+
``` cpp
|
| 56 |
+
template<auto f> constexpr function_ref(nontype_t<f>) noexcept;
|
| 57 |
+
```
|
| 58 |
+
|
| 59 |
+
Let `F` be `decltype(f)`.
|
| 60 |
+
|
| 61 |
+
*Constraints:* *`is-invocable-using`*`<F>` is `true`.
|
| 62 |
+
|
| 63 |
+
*Mandates:* If `is_pointer_v<F> || is_member_pointer_v<F>` is `true`,
|
| 64 |
+
then `f != nullptr` is `true`.
|
| 65 |
+
|
| 66 |
+
*Effects:* Initializes *bound-entity* with a pointer to an unspecified
|
| 67 |
+
object or null pointer value, and *thunk-ptr* with the address of a
|
| 68 |
+
function *`thunk`* such that
|
| 69 |
+
*`thunk`*`(`*`bound-entity`*`, `*`call-args`*`...)` is
|
| 70 |
+
expression-equivalent [[defns.expression.equivalent]] to
|
| 71 |
+
`invoke_r<R>(f, `*`call-args`*`...)`.
|
| 72 |
+
|
| 73 |
+
``` cpp
|
| 74 |
+
template<auto f, class U>
|
| 75 |
+
constexpr function_ref(nontype_t<f>, U&& obj) noexcept;
|
| 76 |
+
```
|
| 77 |
+
|
| 78 |
+
Let `T` be `remove_reference_t<U>` and `F` be `decltype(f)`.
|
| 79 |
+
|
| 80 |
+
*Constraints:*
|
| 81 |
+
|
| 82 |
+
- `is_rvalue_reference_v<U&&>` is `false`, and
|
| 83 |
+
- *`is-invocable-using`*`<F, cv T&>` is `true`.
|
| 84 |
+
|
| 85 |
+
*Mandates:* If `is_pointer_v<F> || is_member_pointer_v<F>` is `true`,
|
| 86 |
+
then `f != nullptr` is `true`.
|
| 87 |
+
|
| 88 |
+
*Effects:* Initializes *bound-entity* with `addressof(obj)`, and
|
| 89 |
+
*thunk-ptr* with the address of a function *`thunk`* such that
|
| 90 |
+
*`thunk`*`(`*`bound-entity`*`, `*`call-args`*`...)` is
|
| 91 |
+
expression-equivalent [[defns.expression.equivalent]] to
|
| 92 |
+
`invoke_r<R>(f, static_cast<cv T&>(obj), `*`call-args`*`...)`.
|
| 93 |
+
|
| 94 |
+
``` cpp
|
| 95 |
+
template<auto f, class T>
|
| 96 |
+
constexpr function_ref(nontype_t<f>, cv T* obj) noexcept;
|
| 97 |
+
```
|
| 98 |
+
|
| 99 |
+
Let `F` be `decltype(f)`.
|
| 100 |
+
|
| 101 |
+
*Constraints:* *`is-invocable-using`*`<F, cv T*>` is `true`.
|
| 102 |
+
|
| 103 |
+
*Mandates:* If `is_pointer_v<F> || is_member_pointer_v<F>` is `true`,
|
| 104 |
+
then `f != nullptr` is `true`.
|
| 105 |
+
|
| 106 |
+
*Preconditions:* If `is_member_pointer_v<F>` is `true`, `obj` is not a
|
| 107 |
+
null pointer.
|
| 108 |
+
|
| 109 |
+
*Effects:* Initializes *bound-entity* with `obj`, and *thunk-ptr* with
|
| 110 |
+
the address of a function *`thunk`* such that
|
| 111 |
+
*`thunk`*`(`*`bound-entity`*`, `*`call-args`*`...)` is
|
| 112 |
+
expression-equivalent [[defns.expression.equivalent]] to
|
| 113 |
+
`invoke_r<R>(f, obj, `*`call-args`*`...)`.
|
| 114 |
+
|
| 115 |
+
``` cpp
|
| 116 |
+
template<class T> function_ref& operator=(T) = delete;
|
| 117 |
+
```
|
| 118 |
+
|
| 119 |
+
*Constraints:*
|
| 120 |
+
|
| 121 |
+
- `T` is not the same type as `function_ref`,
|
| 122 |
+
- `is_pointer_v<T>` is `false`, and
|
| 123 |
+
- `T` is not a specialization of `nontype_t`.
|
| 124 |
+
|