Skip to content

Commit f891ac2

Browse files
author
Dawn Perchik
committed
LWG2901 Variants cannot properly support allocators
1 parent ed34aa6 commit f891ac2

File tree

2 files changed

+1
-79
lines changed

2 files changed

+1
-79
lines changed

source/utilities.tex

Lines changed: 0 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -4189,10 +4189,6 @@
41894189
template <class T> struct hash;
41904190
template <class... Types> struct hash<variant<Types...>>;
41914191
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>;
41964192
}
41974193
\end{codeblock}
41984194

@@ -4222,26 +4218,6 @@
42224218
template <size_t I, class U, class... Args>
42234219
constexpr explicit variant(in_place_index_t<I>, initializer_list<U>, Args&&...);
42244220

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-
42454221
// \ref{variant.dtor}, destructor
42464222
~variant();
42474223

@@ -4553,40 +4529,6 @@
45534529
constructor shall be a constexpr constructor.
45544530
\end{itemdescr}
45554531

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-
45904532
\rSec3[variant.dtor]{Destructor}
45914533

45924534
\indexlibrary{\idxcode{variant}!destructor}%
@@ -5423,27 +5365,6 @@
54235365
\end{itemdescr}
54245366

54255367

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-
54475368
\rSec1[any]{Storage for any type}
54485369

54495370
\pnum

source/xrefdelta.tex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
% Removed features.
1818
%\removedxref{removed.label}
19+
\removedxref{variant.traits}
1920

2021
% Renamed sections.
2122
%\movedxref{old.label}{new.label}

0 commit comments

Comments
 (0)