|
4184 | 4184 | template <class T> struct hash;
|
4185 | 4185 | template <class... Types> struct hash<variant<Types...>>;
|
4186 | 4186 | template <> struct hash<monostate>;
|
4187 |
| - |
4188 |
| - // \ref{variant.traits}, allocator-related traits |
4189 |
| - template <class T, class Alloc> struct uses_allocator; |
4190 |
| - template <class... Types, class Alloc> struct uses_allocator<variant<Types...>, Alloc>; |
4191 | 4187 | }
|
4192 | 4188 | \end{codeblock}
|
4193 | 4189 |
|
|
4217 | 4213 | template <size_t I, class U, class... Args>
|
4218 | 4214 | constexpr explicit variant(in_place_index_t<I>, initializer_list<U>, Args&&...);
|
4219 | 4215 |
|
4220 |
| - // allocator-extended constructors |
4221 |
| - template <class Alloc> |
4222 |
| - variant(allocator_arg_t, const Alloc&); |
4223 |
| - template <class Alloc> |
4224 |
| - variant(allocator_arg_t, const Alloc&, const variant&); |
4225 |
| - template <class Alloc> |
4226 |
| - variant(allocator_arg_t, const Alloc&, variant&&); |
4227 |
| - template <class Alloc, class T> |
4228 |
| - variant(allocator_arg_t, const Alloc&, T&&); |
4229 |
| - template <class Alloc, class T, class... Args> |
4230 |
| - variant(allocator_arg_t, const Alloc&, in_place_type_t<T>, Args&&...); |
4231 |
| - template <class Alloc, class T, class U, class... Args> |
4232 |
| - variant(allocator_arg_t, const Alloc&, in_place_type_t<T>, |
4233 |
| - initializer_list<U>, Args&&...); |
4234 |
| - template <class Alloc, size_t I, class... Args> |
4235 |
| - variant(allocator_arg_t, const Alloc&, in_place_index_t<I>, Args&&...); |
4236 |
| - template <class Alloc, size_t I, class U, class... Args> |
4237 |
| - variant(allocator_arg_t, const Alloc&, in_place_index_t<I>, |
4238 |
| - initializer_list<U>, Args&&...); |
4239 |
| - |
4240 | 4216 | // \ref{variant.dtor}, destructor
|
4241 | 4217 | ~variant();
|
4242 | 4218 |
|
|
4548 | 4524 | constructor shall be a constexpr constructor.
|
4549 | 4525 | \end{itemdescr}
|
4550 | 4526 |
|
4551 |
| -\indexlibrary{\idxcode{variant}!constructor}% |
4552 |
| -\begin{itemdecl} |
4553 |
| -// allocator-extended constructors |
4554 |
| -template <class Alloc> |
4555 |
| - variant(allocator_arg_t, const Alloc& a); |
4556 |
| -template <class Alloc> |
4557 |
| - variant(allocator_arg_t, const Alloc& a, const variant& v); |
4558 |
| -template <class Alloc> |
4559 |
| - variant(allocator_arg_t, const Alloc& a, variant&& v); |
4560 |
| -template <class Alloc, class T> |
4561 |
| - variant(allocator_arg_t, const Alloc& a, T&& t); |
4562 |
| -template <class Alloc, class T, class... Args> |
4563 |
| - variant(allocator_arg_t, const Alloc& a, in_place_type_t<T>, Args&&... args); |
4564 |
| -template <class Alloc, class T, class U, class... Args> |
4565 |
| - variant(allocator_arg_t, const Alloc& a, in_place_type_t<T>, |
4566 |
| - initializer_list<U> il, Args&&... args); |
4567 |
| -template <class Alloc, size_t I, class... Args> |
4568 |
| - variant(allocator_arg_t, const Alloc& a, in_place_index_t<I>, Args&&... args); |
4569 |
| -template <class Alloc, size_t I, class U, class... Args> |
4570 |
| - variant(allocator_arg_t, const Alloc& a, in_place_index_t<I>, |
4571 |
| - initializer_list<U> il, Args&&... args); |
4572 |
| -\end{itemdecl} |
4573 |
| - |
4574 |
| -\begin{itemdescr} |
4575 |
| -\pnum |
4576 |
| -\requires |
4577 |
| -\tcode{Alloc} shall meet the requirements for an Allocator~(\ref{allocator.requirements}). |
4578 |
| - |
4579 |
| -\pnum |
4580 |
| -\effects |
4581 |
| -Equivalent to the preceding constructors except that the contained value is |
4582 |
| -constructed with uses-allocator construction~(\ref{allocator.uses.construction}). |
4583 |
| -\end{itemdescr} |
4584 |
| - |
4585 | 4527 | \rSec3[variant.dtor]{Destructor}
|
4586 | 4528 |
|
4587 | 4529 | \indexlibrary{\idxcode{variant}!destructor}%
|
|
5419 | 5361 | \end{itemdescr}
|
5420 | 5362 |
|
5421 | 5363 |
|
5422 |
| -\rSec2[variant.traits]{Allocator-related traits} |
5423 |
| - |
5424 |
| -\indexlibrary{\idxcode{uses_allocator}!\idxcode{variant}}% |
5425 |
| -\begin{itemdecl} |
5426 |
| -template <class... Types, class Alloc> |
5427 |
| - struct uses_allocator<variant<Types...>, Alloc> : true_type { }; |
5428 |
| -\end{itemdecl} |
5429 |
| - |
5430 |
| -\begin{itemdescr} |
5431 |
| -\pnum |
5432 |
| -\requires \tcode{Alloc} shall be an Allocator~(\ref{allocator.requirements}). |
5433 |
| - |
5434 |
| -\pnum |
5435 |
| -\begin{note} |
5436 |
| -Specialization of this trait informs other library components |
5437 |
| -that variant can be constructed with an allocator, |
5438 |
| -even though it does not have a nested \tcode{allocator_type}. |
5439 |
| -\end{note} |
5440 |
| -\end{itemdescr} |
5441 |
| - |
5442 |
| - |
5443 | 5364 | \rSec1[any]{Storage for any type}
|
5444 | 5365 |
|
5445 | 5366 | \pnum
|
|
0 commit comments