From Jason Turner

[func.wrap.move.ctor]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpshj39t0w/{from.md → to.md} +150 -0
tmp/tmpshj39t0w/{from.md → to.md} RENAMED
@@ -0,0 +1,150 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ##### Constructors, assignment, and destructor <a id="func.wrap.move.ctor">[[func.wrap.move.ctor]]</a>
2
+
3
+ ``` cpp
4
+ template<class VT>
5
+ static constexpr bool is-callable-from = see below;
6
+ ```
7
+
8
+ If *noex* is `true`, *`is-callable-from`*`<VT>` is equal to:
9
+
10
+ ``` cpp
11
+ is_nothrow_invocable_r_v<R, VT cv ref, ArgTypes...> &&
12
+ is_nothrow_invocable_r_v<R, VT inv-quals, ArgTypes...>
13
+ ```
14
+
15
+ Otherwise, *`is-callable-from`*`<VT>` is equal to:
16
+
17
+ ``` cpp
18
+ is_invocable_r_v<R, VT cv ref, ArgTypes...> &&
19
+ is_invocable_r_v<R, VT inv-quals, ArgTypes...>
20
+ ```
21
+
22
+ ``` cpp
23
+ move_only_function() noexcept;
24
+ move_only_function(nullptr_t) noexcept;
25
+ ```
26
+
27
+ *Ensures:* `*this` has no target object.
28
+
29
+ ``` cpp
30
+ move_only_function(move_only_function&& f) noexcept;
31
+ ```
32
+
33
+ *Ensures:* The target object of `*this` is the target object `f` had
34
+ before construction, and `f` is in a valid state with an unspecified
35
+ value.
36
+
37
+ ``` cpp
38
+ template<class F> move_only_function(F&& f);
39
+ ```
40
+
41
+ Let `VT` be `decay_t<F>`.
42
+
43
+ *Constraints:*
44
+
45
+ - `remove_cvref_t<F>` is not the same type as `move_only_function`, and
46
+ - `remove_cvref_t<F>` is not a specialization of `in_place_type_t`, and
47
+ - *`is-callable-from`*`<VT>` is `true`.
48
+
49
+ *Mandates:* `is_constructible_v<VT, F>` is `true`.
50
+
51
+ *Preconditions:* `VT` meets the *Cpp17Destructible* requirements, and if
52
+ `is_move_constructible_v<VT>` is `true`, `VT` meets the
53
+ *Cpp17MoveConstructible* requirements.
54
+
55
+ *Ensures:* `*this` has no target object if any of the following hold:
56
+
57
+ - `f` is a null function pointer value, or
58
+ - `f` is a null member pointer value, or
59
+ - `remove_cvref_t<F>` is a specialization of the `move_only_function`
60
+ class template, and `f` has no target object.
61
+
62
+ Otherwise, `*this` has a target object of type `VT`
63
+ direct-non-list-initialized with `std::forward<F>(f)`.
64
+
65
+ *Throws:* Any exception thrown by the initialization of the target
66
+ object. May throw `bad_alloc` unless `VT` is a function pointer or a
67
+ specialization of `reference_wrapper`.
68
+
69
+ ``` cpp
70
+ template<class T, class... Args>
71
+ explicit move_only_function(in_place_type_t<T>, Args&&... args);
72
+ ```
73
+
74
+ Let `VT` be `decay_t<T>`.
75
+
76
+ *Constraints:*
77
+
78
+ - `is_constructible_v<VT, Args...>` is `true`, and
79
+ - *`is-callable-from`*`<VT>` is `true`.
80
+
81
+ *Mandates:* `VT` is the same type as `T`.
82
+
83
+ *Preconditions:* `VT` meets the *Cpp17Destructible* requirements, and if
84
+ `is_move_constructible_v<VT>` is `true`, `VT` meets the
85
+ *Cpp17MoveConstructible* requirements.
86
+
87
+ *Ensures:* `*this` has a target object of type `VT`
88
+ direct-non-list-initialized with `std::forward<Args>(args)...`.
89
+
90
+ *Throws:* Any exception thrown by the initialization of the target
91
+ object. May throw `bad_alloc` unless `VT` is a function pointer or a
92
+ specialization of `reference_wrapper`.
93
+
94
+ ``` cpp
95
+ template<class T, class U, class... Args>
96
+ explicit move_only_function(in_place_type_t<T>, initializer_list<U> ilist, Args&&... args);
97
+ ```
98
+
99
+ Let `VT` be `decay_t<T>`.
100
+
101
+ *Constraints:*
102
+
103
+ - `is_constructible_v<VT, initializer_list<U>&, Args...>` is `true`, and
104
+ - *`is-callable-from`*`<VT>` is `true`.
105
+
106
+ *Mandates:* `VT` is the same type as `T`.
107
+
108
+ *Preconditions:* `VT` meets the *Cpp17Destructible* requirements, and if
109
+ `is_move_constructible_v<VT>` is `true`, `VT` meets the
110
+ *Cpp17MoveConstructible* requirements.
111
+
112
+ *Ensures:* `*this` has a target object of type `VT`
113
+ direct-non-list-initialized with `ilist, std::forward<Args>(args)...`.
114
+
115
+ *Throws:* Any exception thrown by the initialization of the target
116
+ object. May throw `bad_alloc` unless `VT` is a function pointer or a
117
+ specialization of `reference_wrapper`.
118
+
119
+ ``` cpp
120
+ move_only_function& operator=(move_only_function&& f);
121
+ ```
122
+
123
+ *Effects:* Equivalent to:
124
+ `move_only_function(std::move(f)).swap(*this);`
125
+
126
+ *Returns:* `*this`.
127
+
128
+ ``` cpp
129
+ move_only_function& operator=(nullptr_t) noexcept;
130
+ ```
131
+
132
+ *Effects:* Destroys the target object of `*this`, if any.
133
+
134
+ *Returns:* `*this`.
135
+
136
+ ``` cpp
137
+ template<class F> move_only_function& operator=(F&& f);
138
+ ```
139
+
140
+ *Effects:* Equivalent to:
141
+ `move_only_function(std::forward<F>(f)).swap(*this);`
142
+
143
+ *Returns:* `*this`.
144
+
145
+ ``` cpp
146
+ ~move_only_function();
147
+ ```
148
+
149
+ *Effects:* Destroys the target object of `*this`, if any.
150
+