From Jason Turner

[polymorphic.ctor]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpum84w21y/{from.md → to.md} +179 -0
tmp/tmpum84w21y/{from.md → to.md} RENAMED
@@ -0,0 +1,179 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #### Constructors <a id="polymorphic.ctor">[[polymorphic.ctor]]</a>
2
+
3
+ The following element applies to all functions in  [[polymorphic.ctor]]:
4
+
5
+ *Throws:* Nothing unless `allocator_traits<Allocator>::allocate` or
6
+ `allocator_traits<Allocator>::construct` throws.
7
+
8
+ ``` cpp
9
+ constexpr explicit polymorphic();
10
+ ```
11
+
12
+ *Constraints:* `is_default_constructible_v<Allocator>` is `true`.
13
+
14
+ *Mandates:*
15
+
16
+ - `is_default_constructible_v<T>` is `true`, and
17
+ - `is_copy_constructible_v<T>` is `true`.
18
+
19
+ *Effects:* Constructs an owned object of type `T` with an empty argument
20
+ list using the allocator *alloc*.
21
+
22
+ ``` cpp
23
+ constexpr explicit polymorphic(allocator_arg_t, const Allocator& a);
24
+ ```
25
+
26
+ *Mandates:*
27
+
28
+ - `is_default_constructible_v<T>` is `true`, and
29
+ - `is_copy_constructible_v<T>` is `true`.
30
+
31
+ *Effects:* *alloc* is direct-non-list-initialized with `a`. Constructs
32
+ an owned object of type `T` with an empty argument list using the
33
+ allocator *alloc*.
34
+
35
+ ``` cpp
36
+ constexpr polymorphic(const polymorphic& other);
37
+ ```
38
+
39
+ *Effects:* *alloc* is direct-non-list-initialized with
40
+ `allocator_traits<Allocator>::select_on_container_copy_construction(other.`*`alloc`*`)`.
41
+ If `other` is valueless, `*this` is valueless. Otherwise, constructs an
42
+ owned object of type `U`, where `U` is the type of the owned object in
43
+ `other`, with the owned object in `other` using the allocator *alloc*.
44
+
45
+ ``` cpp
46
+ constexpr polymorphic(allocator_arg_t, const Allocator& a, const polymorphic& other);
47
+ ```
48
+
49
+ *Effects:* *alloc* is direct-non-list-initialized with `a`. If `other`
50
+ is valueless, `*this` is valueless. Otherwise, constructs an owned
51
+ object of type `U`, where `U` is the type of the owned object in
52
+ `other`, with the owned object in `other` using the allocator *alloc*.
53
+
54
+ ``` cpp
55
+ constexpr polymorphic(polymorphic&& other) noexcept;
56
+ ```
57
+
58
+ *Effects:* *alloc* is direct-non-list-initialized with
59
+ `std::move(other.`*`alloc`*`)`. If `other` is valueless, `*this` is
60
+ valueless. Otherwise, either `*this` takes ownership of the owned object
61
+ of `other` or, owns an object of the same type constructed from the
62
+ owned object of `other` considering that owned object as an rvalue,
63
+ using the allocator *alloc*.
64
+
65
+ ``` cpp
66
+ constexpr polymorphic(allocator_arg_t, const Allocator& a, polymorphic&& other)
67
+ noexcept(allocator_traits<Allocator>::is_always_equal::value);
68
+ ```
69
+
70
+ *Effects:* *alloc* is direct-non-list-initialized with `a`. If `other`
71
+ is valueless, `*this` is valueless. Otherwise, if
72
+ *`alloc`*` == other.`*`alloc`* is `true`, either constructs an object of
73
+ type `polymorphic` that owns the owned object of `other`, making `other`
74
+ valueless; or, owns an object of the same type constructed from the
75
+ owned object of `other` considering that owned object as an rvalue.
76
+ Otherwise, if *`alloc`*` != other.`*`alloc`* is `true`, constructs an
77
+ object of type `polymorphic`, considering the owned object in `other` as
78
+ an rvalue, using the allocator *alloc*.
79
+
80
+ ``` cpp
81
+ template<class U = T>
82
+ constexpr explicit polymorphic(U&& u);
83
+ ```
84
+
85
+ *Constraints:* Where `UU` is `remove_cvref_t<U>`,
86
+
87
+ - `is_same_v<UU, polymorphic>` is `false`,
88
+ - `derived_from<UU, T>` is `true`,
89
+ - `is_constructible_v<UU, U>` is `true`,
90
+ - `is_copy_constructible_v<UU>` is `true`,
91
+ - `UU` is not a specialization of `in_place_type_t`, and
92
+ - `is_default_constructible_v<Allocator>` is `true`.
93
+
94
+ *Effects:* Constructs an owned object of type `UU` with
95
+ `std::forward<U>(u)` using the allocator *alloc*.
96
+
97
+ ``` cpp
98
+ template<class U = T>
99
+ constexpr explicit polymorphic(allocator_arg_t, const Allocator& a, U&& u);
100
+ ```
101
+
102
+ *Constraints:* Where `UU` is `remove_cvref_t<U>`,
103
+
104
+ - `is_same_v<UU, polymorphic>` is `false`,
105
+ - `derived_from<UU, T>` is `true`,
106
+ - `is_constructible_v<UU, U>` is `true`,
107
+ - `is_copy_constructible_v<UU>` is `true`, and
108
+ - `UU` is not a specialization of `in_place_type_t`.
109
+
110
+ *Effects:* *alloc* is direct-non-list-initialized with `a`. Constructs
111
+ an owned object of type `UU` with `std::forward<U>(u)` using the
112
+ allocator *alloc*.
113
+
114
+ ``` cpp
115
+ template<class U, class... Ts>
116
+ constexpr explicit polymorphic(in_place_type_t<U>, Ts&&... ts);
117
+ ```
118
+
119
+ *Constraints:*
120
+
121
+ - `is_same_v<remove_cvref_t<U>, U>` is `true`,
122
+ - `derived_from<U, T>` is `true`,
123
+ - `is_constructible_v<U, Ts...>` is `true`,
124
+ - `is_copy_constructible_v<U>` is `true`, and
125
+ - `is_default_constructible_v<Allocator>` is `true`.
126
+
127
+ *Effects:* Constructs an owned object of type `U` with
128
+ `std::forward<Ts>(ts)...` using the allocator *alloc*.
129
+
130
+ ``` cpp
131
+ template<class U, class... Ts>
132
+ constexpr explicit polymorphic(allocator_arg_t, const Allocator& a,
133
+ in_place_type_t<U>, Ts&&... ts);
134
+ ```
135
+
136
+ *Constraints:*
137
+
138
+ - `is_same_v<remove_cvref_t<U>, U>` is `true`,
139
+ - `derived_from<U, T>` is `true`,
140
+ - `is_constructible_v<U, Ts...>` is `true`, and
141
+ - `is_copy_constructible_v<U>` is `true`.
142
+
143
+ *Effects:* *alloc* is direct-non-list-initialized with `a`. Constructs
144
+ an owned object of type `U` with `std::forward<Ts>(ts)...` using the
145
+ allocator *alloc*.
146
+
147
+ ``` cpp
148
+ template<class U, class I, class... Us>
149
+ constexpr explicit polymorphic(in_place_type_t<U>, initializer_list<I> ilist, Us&&... us);
150
+ ```
151
+
152
+ *Constraints:*
153
+
154
+ - `is_same_v<remove_cvref_t<U>, U>` is `true`,
155
+ - `derived_from<U, T>` is `true`,
156
+ - `is_constructible_v<U, initializer_list<I>&, Us...>` is `true`,
157
+ - `is_copy_constructible_v<U>` is `true`, and
158
+ - `is_default_constructible_v<Allocator>` is `true`.
159
+
160
+ *Effects:* Constructs an owned object of type `U` with the arguments
161
+ `ilist, std::forward<Us>(us)...` using the allocator *alloc*.
162
+
163
+ ``` cpp
164
+ template<class U, class I, class... Us>
165
+ constexpr explicit polymorphic(allocator_arg_t, const Allocator& a,
166
+ in_place_type_t<U>, initializer_list<I> ilist, Us&&... us);
167
+ ```
168
+
169
+ *Constraints:*
170
+
171
+ - `is_same_v<remove_cvref_t<U>, U>` is `true`,
172
+ - `derived_from<U, T>` is `true`,
173
+ - `is_constructible_v<U, initializer_list<I>&, Us...>` is `true`, and
174
+ - `is_copy_constructible_v<U>` is `true`.
175
+
176
+ *Effects:* *alloc* is direct-non-list-initialized with `a`. Constructs
177
+ an owned object of type `U` with the arguments
178
+ `ilist, std::forward<Us>(us)...` using the allocator *alloc*.
179
+