Skip to content

Commit 347408e

Browse files
committed
[flat.set] P2767R0 section 3 as seen by LWG
Modified to resolve the merge conflict with LWG3884 (03da5ba).
1 parent f5954d5 commit 347408e

File tree

1 file changed

+85
-89
lines changed

1 file changed

+85
-89
lines changed

source/containers.tex

Lines changed: 85 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -16957,79 +16957,81 @@
1695716957
// \ref{flat.set.cons}, constructors
1695816958
flat_set() : flat_set(key_compare()) { }
1695916959

16960-
template<class Allocator>
16961-
flat_set(const flat_set&, const Allocator& a);
16962-
template<class Allocator>
16963-
flat_set(flat_set&&, const Allocator& a);
16964-
1696516960
explicit flat_set(container_type cont, const key_compare& comp = key_compare());
16966-
template<class Allocator>
16967-
flat_set(const container_type& cont, const Allocator& a);
16968-
template<class Allocator>
16969-
flat_set(const container_type& cont, const key_compare& comp, const Allocator& a);
1697016961

1697116962
flat_set(sorted_unique_t, container_type cont, const key_compare& comp = key_compare())
1697216963
: @\exposid{c}@(std::move(cont)), @\exposid{compare}@(comp) { }
16973-
template<class Allocator>
16974-
flat_set(sorted_unique_t, const container_type& cont, const Allocator& a);
16975-
template<class Allocator>
16976-
flat_set(sorted_unique_t, const container_type& cont,
16977-
const key_compare& comp, const Allocator& a);
1697816964

1697916965
explicit flat_set(const key_compare& comp)
1698016966
: @\exposid{c}@(), @\exposid{compare}@(comp) { }
16981-
template<class Allocator>
16982-
flat_set(const key_compare& comp, const Allocator& a);
16983-
template<class Allocator>
16984-
explicit flat_set(const Allocator& a);
1698516967

1698616968
template<class InputIterator>
1698716969
flat_set(InputIterator first, InputIterator last, const key_compare& comp = key_compare())
1698816970
: @\exposid{c}@(), @\exposid{compare}@(comp)
1698916971
{ insert(first, last); }
16990-
template<class InputIterator, class Allocator>
16991-
flat_set(InputIterator first, InputIterator last,
16992-
const key_compare& comp, const Allocator& a);
16993-
template<class InputIterator, class Allocator>
16994-
flat_set(InputIterator first, InputIterator last, const Allocator& a);
1699516972

1699616973
template<@\exposconcept{container-compatible-range}@<value_type> R>
1699716974
flat_set(from_range_t fr, R&& rg)
1699816975
: flat_set(fr, std::forward<R>(rg), key_compare()) { }
16999-
template<@\exposconcept{container-compatible-range}@<value_type> R, class Allocator>
17000-
flat_set(from_range_t, R&& rg, const Allocator& a);
1700116976
template<@\exposconcept{container-compatible-range}@<value_type> R>
1700216977
flat_set(from_range_t, R&& rg, const key_compare& comp)
1700316978
: flat_set(comp)
1700416979
{ insert_range(std::forward<R>(rg)); }
17005-
template<@\exposconcept{container-compatible-range}@<value_type> R, class Allocator>
17006-
flat_set(from_range_t, R&& rg, const key_compare& comp, const Allocator& a);
1700716980

1700816981
template<class InputIterator>
1700916982
flat_set(sorted_unique_t, InputIterator first, InputIterator last,
1701016983
const key_compare& comp = key_compare())
1701116984
: @\exposid{c}@(first, last), @\exposid{compare}@(comp) { }
17012-
template<class InputIterator, class Allocator>
17013-
flat_set(sorted_unique_t, InputIterator first, InputIterator last,
17014-
const key_compare& comp, const Allocator& a);
17015-
template<class InputIterator, class Allocator>
17016-
flat_set(sorted_unique_t, InputIterator first, InputIterator last, const Allocator& a);
1701716985

1701816986
flat_set(initializer_list<value_type> il, const key_compare& comp = key_compare())
1701916987
: flat_set(il.begin(), il.end(), comp) { }
17020-
template<class Allocator>
17021-
flat_set(initializer_list<value_type> il, const key_compare& comp, const Allocator& a);
17022-
template<class Allocator>
17023-
flat_set(initializer_list<value_type> il, const Allocator& a);
1702416988

1702516989
flat_set(sorted_unique_t s, initializer_list<value_type> il,
1702616990
const key_compare& comp = key_compare())
1702716991
: flat_set(s, il.begin(), il.end(), comp) { }
17028-
template<class Allocator>
16992+
16993+
// \ref{flat.set.cons.alloc}, constructors with allocators
16994+
16995+
template<class Alloc>
16996+
flat_set(const flat_set&, const Alloc& a);
16997+
template<class Alloc>
16998+
flat_set(flat_set&&, const Alloc& a);
16999+
template<class Alloc>
17000+
flat_set(const container_type& cont, const Alloc& a);
17001+
template<class Alloc>
17002+
flat_set(const container_type& cont, const key_compare& comp, const Alloc& a);
17003+
template<class Alloc>
17004+
flat_set(sorted_unique_t, const container_type& cont, const Alloc& a);
17005+
template<class Alloc>
17006+
flat_set(sorted_unique_t, const container_type& cont,
17007+
const key_compare& comp, const Alloc& a);
17008+
template<class Alloc>
17009+
flat_set(const key_compare& comp, const Alloc& a);
17010+
template<class Alloc>
17011+
explicit flat_set(const Alloc& a);
17012+
template<class InputIterator, class Alloc>
17013+
flat_set(InputIterator first, InputIterator last,
17014+
const key_compare& comp, const Alloc& a);
17015+
template<class InputIterator, class Alloc>
17016+
flat_set(InputIterator first, InputIterator last, const Alloc& a);
17017+
template<@\exposconcept{container-compatible-range}@<value_type> R, class Alloc>
17018+
flat_set(from_range_t, R&& rg, const Alloc& a);
17019+
template<@\exposconcept{container-compatible-range}@<value_type> R, class Alloc>
17020+
flat_set(from_range_t, R&& rg, const key_compare& comp, const Alloc& a);
17021+
template<class InputIterator, class Alloc>
17022+
flat_set(sorted_unique_t, InputIterator first, InputIterator last,
17023+
const key_compare& comp, const Alloc& a);
17024+
template<class InputIterator, class Alloc>
17025+
flat_set(sorted_unique_t, InputIterator first, InputIterator last, const Alloc& a);
17026+
template<class Alloc>
17027+
flat_set(initializer_list<value_type> il, const key_compare& comp, const Alloc& a);
17028+
template<class Alloc>
17029+
flat_set(initializer_list<value_type> il, const Alloc& a);
17030+
template<class Alloc>
1702917031
flat_set(sorted_unique_t, initializer_list<value_type> il,
17030-
const key_compare& comp, const Allocator& a);
17031-
template<class Allocator>
17032-
flat_set(sorted_unique_t, initializer_list<value_type> il, const Allocator& a);
17032+
const key_compare& comp, const Alloc& a);
17033+
template<class Alloc>
17034+
flat_set(sorted_unique_t, initializer_list<value_type> il, const Alloc& a);
1703317035

1703417036
flat_set& operator=(initializer_list<value_type>);
1703517037

@@ -17214,23 +17216,25 @@
1721417216

1721517217
\pnum
1721617218
\complexity
17217-
Linear in $N$ if \tcode{cont} is sorted with respect to \exposid{compare} and
17219+
Linear in $N$ if \tcode{cont} is already sorted with respect to \exposid{compare} and
1721817220
otherwise $N \log N$, where $N$ is the value of \tcode{cont.size()} before this call.
1721917221
\end{itemdescr}
1722017222

17223+
\rSec3[flat.set.cons.alloc]{Constructors with allocators}
17224+
17225+
\pnum
17226+
The constructors in this subclause shall not participate in overload resolution
17227+
unless \tcode{uses_allocator_v<container_type, Alloc>} is \tcode{true}.
17228+
1722117229
\indexlibraryctor{flat_set}%
1722217230
\begin{itemdecl}
17223-
template<class Allocator>
17224-
flat_set(const container_type& cont, const Allocator& a);
17225-
template<class Allocator>
17226-
flat_set(const container_type& cont, const key_compare& comp, const Allocator& a);
17231+
template<class Alloc>
17232+
flat_set(const container_type& cont, const Alloc& a);
17233+
template<class Alloc>
17234+
flat_set(const container_type& cont, const key_compare& comp, const Alloc& a);
1722717235
\end{itemdecl}
1722817236

1722917237
\begin{itemdescr}
17230-
\pnum
17231-
\constraints
17232-
\tcode{uses_allocator_v<container_type, Allocator>} is \tcode{true}.
17233-
1723417238
\pnum
1723517239
\effects
1723617240
Equivalent to
@@ -17245,18 +17249,14 @@
1724517249

1724617250
\indexlibraryctor{flat_set}%
1724717251
\begin{itemdecl}
17248-
template<class Allocator>
17249-
flat_set(sorted_unique_t s, const container_type& cont, const Allocator& a);
17250-
template<class Allocator>
17252+
template<class Alloc>
17253+
flat_set(sorted_unique_t s, const container_type& cont, const Alloc& a);
17254+
template<class Alloc>
1725117255
flat_set(sorted_unique_t s, const container_type& cont,
17252-
const key_compare& comp, const Allocator& a);
17256+
const key_compare& comp, const Alloc& a);
1725317257
\end{itemdecl}
1725417258

1725517259
\begin{itemdescr}
17256-
\pnum
17257-
\constraints
17258-
\tcode{uses_allocator_v<container_type, Allocator>} is \tcode{true}.
17259-
1726017260
\pnum
1726117261
\effects
1726217262
Equivalent to
@@ -17271,43 +17271,39 @@
1727117271

1727217272
\indexlibraryctor{flat_set}%
1727317273
\begin{itemdecl}
17274-
template<class Allocator>
17275-
flat_set(const flat_set&, const Allocator& a);
17276-
template<class Allocator>
17277-
flat_set(flat_set&&, const Allocator& a);
17278-
template<class Allocator>
17279-
flat_set(const key_compare& comp, const Allocator& a);
17280-
template<class Allocator>
17281-
explicit flat_set(const Allocator& a);
17282-
template<class InputIterator, class Allocator>
17283-
flat_set(InputIterator first, InputIterator last, const key_compare& comp, const Allocator& a);
17284-
template<class InputIterator, class Allocator>
17285-
flat_set(InputIterator first, InputIterator last, const Allocator& a);
17286-
template<@\exposconcept{container-compatible-range}@<value_type> R, class Allocator>
17287-
flat_set(from_range_t, R&& rg, const Allocator& a);
17288-
template<@\exposconcept{container-compatible-range}@<value_type> R, class Allocator>
17289-
flat_set(from_range_t, R&& rg, const key_compare& comp, const Allocator& a);
17290-
template<class InputIterator, class Allocator>
17274+
template<class Alloc>
17275+
flat_set(const flat_set&, const Alloc& a);
17276+
template<class Alloc>
17277+
flat_set(flat_set&&, const Alloc& a);
17278+
template<class Alloc>
17279+
flat_set(const key_compare& comp, const Alloc& a);
17280+
template<class Alloc>
17281+
explicit flat_set(const Alloc& a);
17282+
template<class InputIterator, class Alloc>
17283+
flat_set(InputIterator first, InputIterator last, const key_compare& comp, const Alloc& a);
17284+
template<class InputIterator, class Alloc>
17285+
flat_set(InputIterator first, InputIterator last, const Alloc& a);
17286+
template<@\exposconcept{container-compatible-range}@<value_type> R, class Alloc>
17287+
flat_set(from_range_t, R&& rg, const Alloc& a);
17288+
template<@\exposconcept{container-compatible-range}@<value_type> R, class Alloc>
17289+
flat_set(from_range_t, R&& rg, const key_compare& comp, const Alloc& a);
17290+
template<class InputIterator, class Alloc>
1729117291
flat_set(sorted_unique_t, InputIterator first, InputIterator last,
17292-
const key_compare& comp, const Allocator& a);
17293-
template<class InputIterator, class Allocator>
17294-
flat_set(sorted_unique_t, InputIterator first, InputIterator last, const Allocator& a);
17295-
template<class Allocator>
17296-
flat_set(initializer_list<value_type> il, const key_compare& comp, const Allocator& a);
17297-
template<class Allocator>
17298-
flat_set(initializer_list<value_type> il, const Allocator& a);
17299-
template<class Allocator>
17292+
const key_compare& comp, const Alloc& a);
17293+
template<class InputIterator, class Alloc>
17294+
flat_set(sorted_unique_t, InputIterator first, InputIterator last, const Alloc& a);
17295+
template<class Alloc>
17296+
flat_set(initializer_list<value_type> il, const key_compare& comp, const Alloc& a);
17297+
template<class Alloc>
17298+
flat_set(initializer_list<value_type> il, const Alloc& a);
17299+
template<class Alloc>
1730017300
flat_set(sorted_unique_t, initializer_list<value_type> il,
17301-
const key_compare& comp, const Allocator& a);
17302-
template<class Allocator>
17303-
flat_set(sorted_unique_t, initializer_list<value_type> il, const Allocator& a);
17301+
const key_compare& comp, const Alloc& a);
17302+
template<class Alloc>
17303+
flat_set(sorted_unique_t, initializer_list<value_type> il, const Alloc& a);
1730417304
\end{itemdecl}
1730517305

1730617306
\begin{itemdescr}
17307-
\pnum
17308-
\constraints
17309-
\tcode{uses_allocator_v<container_type, Allocator>} is \tcode{true}.
17310-
1731117307
\pnum
1731217308
\effects
1731317309
Equivalent to the corresponding non-allocator constructors

0 commit comments

Comments
 (0)