Skip to content

Commit 644cb46

Browse files
authored
Merge 2021-06 LWG Motion 7
P1425R4 Iterators pair constructors for stack and queue
2 parents 3d42b3c + a35af65 commit 644cb46

File tree

2 files changed

+86
-0
lines changed

2 files changed

+86
-0
lines changed

source/containers.tex

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9852,11 +9852,14 @@
98529852
queue() : queue(Container()) {}
98539853
explicit queue(const Container&);
98549854
explicit queue(Container&&);
9855+
template<class InputIterator> queue(InputIterator first, InputIterator last);
98559856
template<class Alloc> explicit queue(const Alloc&);
98569857
template<class Alloc> queue(const Container&, const Alloc&);
98579858
template<class Alloc> queue(Container&&, const Alloc&);
98589859
template<class Alloc> queue(const queue&, const Alloc&);
98599860
template<class Alloc> queue(queue&&, const Alloc&);
9861+
template<class InputIterator, class Alloc>
9862+
queue(InputIterator first, InputIterator last, const Alloc&);
98609863

98619864
[[nodiscard]] bool empty() const { return c.empty(); }
98629865
size_type size() const { return c.size(); }
@@ -9877,9 +9880,17 @@
98779880
template<class Container>
98789881
queue(Container) -> queue<typename Container::value_type, Container>;
98799882

9883+
template<class InputIterator>
9884+
queue(InputIterator, InputIterator) -> queue<@\exposid{iter-value-type}@<InputIterator>>;
9885+
98809886
template<class Container, class Allocator>
98819887
queue(Container, Allocator) -> queue<typename Container::value_type, Container>;
98829888

9889+
template<class InputIterator, class Allocator>
9890+
queue(InputIterator, InputIterator, Allocator)
9891+
-> queue<@\exposid{iter-value-type}@<InputIterator>, deque<@\exposid{iter-value-type}@<InputIterator>,
9892+
Allocator>>;
9893+
98839894
template<class T, class Container, class Alloc>
98849895
struct uses_allocator<queue<T, Container>, Alloc>
98859896
: uses_allocator<Container, Alloc>::type { };
@@ -9888,6 +9899,7 @@
98889899

98899900
\rSec3[queue.cons]{Constructors}
98909901

9902+
\indexlibraryctor{queue}%
98919903
\begin{itemdecl}
98929904
explicit queue(const Container& cont);
98939905
\end{itemdecl}
@@ -9898,6 +9910,7 @@
98989910
Initializes \tcode{c} with \tcode{cont}.
98999911
\end{itemdescr}
99009912

9913+
\indexlibraryctor{queue}%
99019914
\begin{itemdecl}
99029915
explicit queue(Container&& cont);
99039916
\end{itemdecl}
@@ -9908,12 +9921,26 @@
99089921
Initializes \tcode{c} with \tcode{std::move(cont)}.
99099922
\end{itemdescr}
99109923

9924+
\indexlibraryctor{queue}%
9925+
\begin{itemdecl}
9926+
template<class InputIterator>
9927+
queue(InputIterator first, InputIterator last);
9928+
\end{itemdecl}
9929+
9930+
\begin{itemdescr}
9931+
\pnum
9932+
\effects
9933+
Initializes \tcode{c} with
9934+
\tcode{first} as the first argument and \tcode{last} as the second argument.
9935+
\end{itemdescr}
9936+
99119937
\rSec3[queue.cons.alloc]{Constructors with allocators}
99129938

99139939
\pnum
99149940
If \tcode{uses_allocator_v<container_type, Alloc>} is \tcode{false}
99159941
the constructors in this subclause shall not participate in overload resolution.
99169942

9943+
\indexlibraryctor{queue}%
99179944
\begin{itemdecl}
99189945
template<class Alloc> explicit queue(const Alloc& a);
99199946
\end{itemdecl}
@@ -9924,6 +9951,7 @@
99249951
Initializes \tcode{c} with \tcode{a}.
99259952
\end{itemdescr}
99269953

9954+
\indexlibraryctor{queue}%
99279955
\begin{itemdecl}
99289956
template<class Alloc> queue(const container_type& cont, const Alloc& a);
99299957
\end{itemdecl}
@@ -9935,6 +9963,7 @@
99359963
as the second argument.
99369964
\end{itemdescr}
99379965

9966+
\indexlibraryctor{queue}%
99389967
\begin{itemdecl}
99399968
template<class Alloc> queue(container_type&& cont, const Alloc& a);
99409969
\end{itemdecl}
@@ -9946,6 +9975,7 @@
99469975
as the second argument.
99479976
\end{itemdescr}
99489977

9978+
\indexlibraryctor{queue}%
99499979
\begin{itemdecl}
99509980
template<class Alloc> queue(const queue& q, const Alloc& a);
99519981
\end{itemdecl}
@@ -9957,6 +9987,7 @@
99579987
second argument.
99589988
\end{itemdescr}
99599989

9990+
\indexlibraryctor{queue}%
99609991
\begin{itemdecl}
99619992
template<class Alloc> queue(queue&& q, const Alloc& a);
99629993
\end{itemdecl}
@@ -9968,6 +9999,21 @@
99689999
as the second argument.
996910000
\end{itemdescr}
997010001

10002+
\indexlibraryctor{queue}%
10003+
\begin{itemdecl}
10004+
template<class InputIterator, class Alloc>
10005+
queue(InputIterator first, InputIterator last, const Alloc& alloc);
10006+
\end{itemdecl}
10007+
10008+
\begin{itemdescr}
10009+
\pnum
10010+
\effects
10011+
Initializes \tcode{c} with
10012+
\tcode{first} as the first argument,
10013+
\tcode{last} as the second argument, and
10014+
\tcode{alloc} as the third argument.
10015+
\end{itemdescr}
10016+
997110017
\rSec3[queue.ops]{Operators}
997210018

997310019
\indexlibrarymember{operator==}{queue}%
@@ -10535,11 +10581,14 @@
1053510581
stack() : stack(Container()) {}
1053610582
explicit stack(const Container&);
1053710583
explicit stack(Container&&);
10584+
template<class InputIterator> stack(InputIterator first, InputIterator last);
1053810585
template<class Alloc> explicit stack(const Alloc&);
1053910586
template<class Alloc> stack(const Container&, const Alloc&);
1054010587
template<class Alloc> stack(Container&&, const Alloc&);
1054110588
template<class Alloc> stack(const stack&, const Alloc&);
1054210589
template<class Alloc> stack(stack&&, const Alloc&);
10590+
template<class InputIterator, class Alloc>
10591+
stack(InputIterator first, InputIterator last, const Alloc&);
1054310592

1054410593
[[nodiscard]] bool empty() const { return c.empty(); }
1054510594
size_type size() const { return c.size(); }
@@ -10558,9 +10607,17 @@
1055810607
template<class Container>
1055910608
stack(Container) -> stack<typename Container::value_type, Container>;
1056010609

10610+
template<class InputIterator>
10611+
stack(InputIterator, InputIterator) -> stack<@\exposid{iter-value-type}@<InputIterator>>;
10612+
1056110613
template<class Container, class Allocator>
1056210614
stack(Container, Allocator) -> stack<typename Container::value_type, Container>;
1056310615

10616+
template<class InputIterator, class Allocator>
10617+
stack(InputIterator, InputIterator, Allocator)
10618+
-> stack<@\exposid{iter-value-type}@<InputIterator>, deque<@\exposid{iter-value-type}@<InputIterator>,
10619+
Allocator>>;
10620+
1056410621
template<class T, class Container, class Alloc>
1056510622
struct uses_allocator<stack<T, Container>, Alloc>
1056610623
: uses_allocator<Container, Alloc>::type { };
@@ -10591,6 +10648,19 @@
1059110648
Initializes \tcode{c} with \tcode{std::move(cont)}.
1059210649
\end{itemdescr}
1059310650

10651+
\indexlibraryctor{stack}%
10652+
\begin{itemdecl}
10653+
template<class InputIterator>
10654+
stack(InputIterator first, InputIterator last);
10655+
\end{itemdecl}
10656+
10657+
\begin{itemdescr}
10658+
\pnum
10659+
\effects
10660+
Initializes \tcode{c} with
10661+
\tcode{first} as the first argument and \tcode{last} as the second argument.
10662+
\end{itemdescr}
10663+
1059410664
\rSec3[stack.cons.alloc]{Constructors with allocators}
1059510665

1059610666
\pnum
@@ -10656,6 +10726,21 @@
1065610726
as the second argument.
1065710727
\end{itemdescr}
1065810728

10729+
\indexlibraryctor{stack}%
10730+
\begin{itemdecl}
10731+
template<class InputIterator, class Alloc>
10732+
stack(InputIterator first, InputIterator last, const Alloc& alloc);
10733+
\end{itemdecl}
10734+
10735+
\begin{itemdescr}
10736+
\pnum
10737+
\effects
10738+
Initializes \tcode{c} with
10739+
\tcode{first} as the first argument,
10740+
\tcode{last} as the second argument, and
10741+
\tcode{alloc} as the third argument.
10742+
\end{itemdescr}
10743+
1065910744
\rSec3[stack.ops]{Operators}
1066010745

1066110746
\indexlibrarymember{operator==}{stack}%

source/support.tex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,7 @@
556556
#define @\defnlibxname{cpp_lib_allocator_traits_is_always_equal}@ 201411L
557557
// also in \libheader{memory}, \libheader{scoped_allocator}, \libheader{string}, \libheader{deque}, \libheader{forward_list}, \libheader{list}, \libheader{vector},
558558
// \libheader{map}, \libheader{set}, \libheader{unordered_map}, \libheader{unordered_set}
559+
#define @\defnlibxname{cpp_lib_adaptor_iterator_pair_constructor}@ 202106L // also in \libheader{stack}, \libheader{queue>}
559560
#define @\defnlibxname{cpp_lib_any}@ 201606L // also in \libheader{any}
560561
#define @\defnlibxname{cpp_lib_apply}@ 201603L // also in \libheader{tuple}
561562
#define @\defnlibxname{cpp_lib_array_constexpr}@ 201811L // also in \libheader{iterator}, \libheader{array}

0 commit comments

Comments
 (0)