|
4189 | 4189 | template <class T> struct hash;
|
4190 | 4190 | template <class... Types> struct hash<variant<Types...>>;
|
4191 | 4191 | template <> struct hash<monostate>;
|
4192 |
| - |
4193 |
| - // \ref{variant.traits}, allocator-related traits |
4194 |
| - template <class T, class Alloc> struct uses_allocator; |
4195 |
| - template <class... Types, class Alloc> struct uses_allocator<variant<Types...>, Alloc>; |
4196 | 4192 | }
|
4197 | 4193 | \end{codeblock}
|
4198 | 4194 |
|
|
4222 | 4218 | template <size_t I, class U, class... Args>
|
4223 | 4219 | constexpr explicit variant(in_place_index_t<I>, initializer_list<U>, Args&&...);
|
4224 | 4220 |
|
4225 |
| - // allocator-extended constructors |
4226 |
| - template <class Alloc> |
4227 |
| - variant(allocator_arg_t, const Alloc&); |
4228 |
| - template <class Alloc> |
4229 |
| - variant(allocator_arg_t, const Alloc&, const variant&); |
4230 |
| - template <class Alloc> |
4231 |
| - variant(allocator_arg_t, const Alloc&, variant&&); |
4232 |
| - template <class Alloc, class T> |
4233 |
| - variant(allocator_arg_t, const Alloc&, T&&); |
4234 |
| - template <class Alloc, class T, class... Args> |
4235 |
| - variant(allocator_arg_t, const Alloc&, in_place_type_t<T>, Args&&...); |
4236 |
| - template <class Alloc, class T, class U, class... Args> |
4237 |
| - variant(allocator_arg_t, const Alloc&, in_place_type_t<T>, |
4238 |
| - initializer_list<U>, Args&&...); |
4239 |
| - template <class Alloc, size_t I, class... Args> |
4240 |
| - variant(allocator_arg_t, const Alloc&, in_place_index_t<I>, Args&&...); |
4241 |
| - template <class Alloc, size_t I, class U, class... Args> |
4242 |
| - variant(allocator_arg_t, const Alloc&, in_place_index_t<I>, |
4243 |
| - initializer_list<U>, Args&&...); |
4244 |
| - |
4245 | 4221 | // \ref{variant.dtor}, destructor
|
4246 | 4222 | ~variant();
|
4247 | 4223 |
|
|
4553 | 4529 | constructor shall be a constexpr constructor.
|
4554 | 4530 | \end{itemdescr}
|
4555 | 4531 |
|
4556 |
| -\indexlibrary{\idxcode{variant}!constructor}% |
4557 |
| -\begin{itemdecl} |
4558 |
| -// allocator-extended constructors |
4559 |
| -template <class Alloc> |
4560 |
| - variant(allocator_arg_t, const Alloc& a); |
4561 |
| -template <class Alloc> |
4562 |
| - variant(allocator_arg_t, const Alloc& a, const variant& v); |
4563 |
| -template <class Alloc> |
4564 |
| - variant(allocator_arg_t, const Alloc& a, variant&& v); |
4565 |
| -template <class Alloc, class T> |
4566 |
| - variant(allocator_arg_t, const Alloc& a, T&& t); |
4567 |
| -template <class Alloc, class T, class... Args> |
4568 |
| - variant(allocator_arg_t, const Alloc& a, in_place_type_t<T>, Args&&... args); |
4569 |
| -template <class Alloc, class T, class U, class... Args> |
4570 |
| - variant(allocator_arg_t, const Alloc& a, in_place_type_t<T>, |
4571 |
| - initializer_list<U> il, Args&&... args); |
4572 |
| -template <class Alloc, size_t I, class... Args> |
4573 |
| - variant(allocator_arg_t, const Alloc& a, in_place_index_t<I>, Args&&... args); |
4574 |
| -template <class Alloc, size_t I, class U, class... Args> |
4575 |
| - variant(allocator_arg_t, const Alloc& a, in_place_index_t<I>, |
4576 |
| - initializer_list<U> il, Args&&... args); |
4577 |
| -\end{itemdecl} |
4578 |
| - |
4579 |
| -\begin{itemdescr} |
4580 |
| -\pnum |
4581 |
| -\requires |
4582 |
| -\tcode{Alloc} shall meet the requirements for an Allocator~(\ref{allocator.requirements}). |
4583 |
| - |
4584 |
| -\pnum |
4585 |
| -\effects |
4586 |
| -Equivalent to the preceding constructors except that the contained value is |
4587 |
| -constructed with uses-allocator construction~(\ref{allocator.uses.construction}). |
4588 |
| -\end{itemdescr} |
4589 |
| - |
4590 | 4532 | \rSec3[variant.dtor]{Destructor}
|
4591 | 4533 |
|
4592 | 4534 | \indexlibrary{\idxcode{variant}!destructor}%
|
|
5423 | 5365 | \end{itemdescr}
|
5424 | 5366 |
|
5425 | 5367 |
|
5426 |
| -\rSec2[variant.traits]{Allocator-related traits} |
5427 |
| - |
5428 |
| -\indexlibrary{\idxcode{uses_allocator}!\idxcode{variant}}% |
5429 |
| -\begin{itemdecl} |
5430 |
| -template <class... Types, class Alloc> |
5431 |
| - struct uses_allocator<variant<Types...>, Alloc> : true_type { }; |
5432 |
| -\end{itemdecl} |
5433 |
| - |
5434 |
| -\begin{itemdescr} |
5435 |
| -\pnum |
5436 |
| -\requires \tcode{Alloc} shall be an Allocator~(\ref{allocator.requirements}). |
5437 |
| - |
5438 |
| -\pnum |
5439 |
| -\begin{note} |
5440 |
| -Specialization of this trait informs other library components |
5441 |
| -that variant can be constructed with an allocator, |
5442 |
| -even though it does not have a nested \tcode{allocator_type}. |
5443 |
| -\end{note} |
5444 |
| -\end{itemdescr} |
5445 |
| - |
5446 |
| - |
5447 | 5368 | \rSec1[any]{Storage for any type}
|
5448 | 5369 |
|
5449 | 5370 | \pnum
|
|
0 commit comments