Skip to content

Commit aee1fa9

Browse files
committed
[flat.multiset] P2767R0 section 3 as seen by LWG
Modified to resolve the merge conflict with LWG3884 (03da5ba).
1 parent 4f50bc3 commit aee1fa9

File tree

1 file changed

+86
-90
lines changed

1 file changed

+86
-90
lines changed

source/containers.tex

Lines changed: 86 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -17620,83 +17620,85 @@
1762017620
// \ref{flat.multiset.cons}, constructors
1762117621
flat_multiset() : flat_multiset(key_compare()) { }
1762217622

17623-
template<class Allocator>
17624-
flat_multiset(const flat_multiset&, const Allocator& a);
17625-
template<class Allocator>
17626-
flat_multiset(flat_multiset&&, const Allocator& a);
17627-
1762817623
explicit flat_multiset(container_type cont, const key_compare& comp = key_compare());
17629-
template<class Allocator>
17630-
flat_multiset(const container_type& cont, const Allocator& a);
17631-
template<class Allocator>
17632-
flat_multiset(const container_type& cont, const key_compare& comp, const Allocator& a);
1763317624

1763417625
flat_multiset(sorted_equivalent_t, container_type cont,
1763517626
const key_compare& comp = key_compare())
1763617627
: @\exposid{c}@(std::move(cont)), @\exposid{compare}@(comp) { }
17637-
template<class Allocator>
17638-
flat_multiset(sorted_equivalent_t, const container_type& cont, const Allocator& a);
17639-
template<class Allocator>
17640-
flat_multiset(sorted_equivalent_t, const container_type& cont,
17641-
const key_compare& comp, const Allocator& a);
1764217628

1764317629
explicit flat_multiset(const key_compare& comp)
1764417630
: @\exposid{c}@(), @\exposid{compare}@(comp) { }
17645-
template<class Allocator>
17646-
flat_multiset(const key_compare& comp, const Allocator& a);
17647-
template<class Allocator>
17648-
explicit flat_multiset(const Allocator& a);
1764917631

1765017632
template<class InputIterator>
1765117633
flat_multiset(InputIterator first, InputIterator last,
1765217634
const key_compare& comp = key_compare())
1765317635
: @\exposid{c}@(), @\exposid{compare}@(comp)
1765417636
{ insert(first, last); }
17655-
template<class InputIterator, class Allocator>
17656-
flat_multiset(InputIterator first, InputIterator last,
17657-
const key_compare& comp, const Allocator& a);
17658-
template<class InputIterator, class Allocator>
17659-
flat_multiset(InputIterator first, InputIterator last, const Allocator& a);
1766017637

1766117638
template<@\exposconcept{container-compatible-range}@<value_type> R>
1766217639
flat_multiset(from_range_t fr, R&& rg)
1766317640
: flat_multiset(fr, std::forward<R>(rg), key_compare()) { }
17664-
template<@\exposconcept{container-compatible-range}@<value_type> R, class Allocator>
17665-
flat_multiset(from_range_t, R&& rg, const Allocator& a);
1766617641
template<@\exposconcept{container-compatible-range}@<value_type> R>
1766717642
flat_multiset(from_range_t, R&& rg, const key_compare& comp)
1766817643
: flat_multiset(comp)
1766917644
{ insert_range(std::forward<R>(rg)); }
17670-
template<@\exposconcept{container-compatible-range}@<value_type> R, class Allocator>
17671-
flat_multiset(from_range_t, R&& rg, const key_compare& comp, const Allocator& a);
1767217645

1767317646
template<class InputIterator>
1767417647
flat_multiset(sorted_equivalent_t, InputIterator first, InputIterator last,
1767517648
const key_compare& comp = key_compare())
1767617649
: @\exposid{c}@(first, last), @\exposid{compare}@(comp) { }
17677-
template<class InputIterator, class Allocator>
17678-
flat_multiset(sorted_equivalent_t, InputIterator first, InputIterator last,
17679-
const key_compare& comp, const Allocator& a);
17680-
template<class InputIterator, class Allocator>
17681-
flat_multiset(sorted_equivalent_t, InputIterator first, InputIterator last,
17682-
const Allocator& a);
1768317650

1768417651
flat_multiset(initializer_list<value_type> il, const key_compare& comp = key_compare())
1768517652
: flat_multiset(il.begin(), il.end(), comp) { }
17686-
template<class Allocator>
17687-
flat_multiset(initializer_list<value_type> il, const key_compare& comp,
17688-
const Allocator& a);
17689-
template<class Allocator>
17690-
flat_multiset(initializer_list<value_type> il, const Allocator& a);
1769117653

1769217654
flat_multiset(sorted_equivalent_t s, initializer_list<value_type> il,
1769317655
const key_compare& comp = key_compare())
1769417656
: flat_multiset(s, il.begin(), il.end(), comp) { }
17695-
template<class Allocator>
17657+
17658+
// \ref{flat.multiset.cons.alloc}, constructors with allocators
17659+
17660+
template<class Alloc>
17661+
flat_multiset(const flat_multiset&, const Alloc& a);
17662+
template<class Alloc>
17663+
flat_multiset(flat_multiset&&, const Alloc& a);
17664+
template<class Alloc>
17665+
flat_multiset(const container_type& cont, const Alloc& a);
17666+
template<class Alloc>
17667+
flat_multiset(const container_type& cont, const key_compare& comp, const Alloc& a);
17668+
template<class Alloc>
17669+
flat_multiset(sorted_equivalent_t, const container_type&, const Alloc& a);
17670+
template<class Alloc>
17671+
flat_multiset(sorted_equivalent_t, const container_type& cont,
17672+
const key_compare& comp, const Alloc& a);
17673+
template<class Alloc>
17674+
flat_multiset(const key_compare& comp, const Alloc& a);
17675+
template<class Alloc>
17676+
explicit flat_multiset(const Alloc& a);
17677+
template<class InputIterator, class Alloc>
17678+
flat_multiset(InputIterator first, InputIterator last,
17679+
const key_compare& comp, const Alloc& a);
17680+
template<class InputIterator, class Alloc>
17681+
flat_multiset(InputIterator first, InputIterator last, const Alloc& a);
17682+
template<@\exposconcept{container-compatible-range}@<value_type> R, class Alloc>
17683+
flat_multiset(from_range_t, R&& rg, const Alloc& a);
17684+
template<@\exposconcept{container-compatible-range}@<value_type> R, class Alloc>
17685+
flat_multiset(from_range_t, R&& rg, const key_compare& comp, const Alloc& a);
17686+
template<class InputIterator, class Alloc>
17687+
flat_multiset(sorted_equivalent_t, InputIterator first, InputIterator last,
17688+
const key_compare& comp, const Alloc& a);
17689+
template<class InputIterator, class Alloc>
17690+
flat_multiset(sorted_equivalent_t, InputIterator first, InputIterator last,
17691+
const Alloc& a);
17692+
template<class Alloc>
17693+
flat_multiset(initializer_list<value_type> il, const key_compare& comp,
17694+
const Alloc& a);
17695+
template<class Alloc>
17696+
flat_multiset(initializer_list<value_type> il, const Alloc& a);
17697+
template<class Alloc>
1769617698
flat_multiset(sorted_equivalent_t, initializer_list<value_type> il,
17697-
const key_compare& comp, const Allocator& a);
17698-
template<class Allocator>
17699-
flat_multiset(sorted_equivalent_t, initializer_list<value_type> il, const Allocator& a);
17699+
const key_compare& comp, const Alloc& a);
17700+
template<class Alloc>
17701+
flat_multiset(sorted_equivalent_t, initializer_list<value_type> il, const Alloc& a);
1770017702

1770117703
flat_multiset& operator=(initializer_list<value_type>);
1770217704

@@ -17878,23 +17880,25 @@
1787817880

1787917881
\pnum
1788017882
\complexity
17881-
Linear in $N$ if \tcode{cont} is sorted with respect to \exposid{compare} and
17883+
Linear in $N$ if \tcode{cont} is already sorted with respect to \exposid{compare} and
1788217884
otherwise $N \log N$, where $N$ is the value of \tcode{cont.size()} before this call.
1788317885
\end{itemdescr}
1788417886

17887+
\rSec3[flat.multiset.cons.alloc]{Constructors with allocators}
17888+
17889+
\pnum
17890+
The constructors in this subclause shall not participate in overload resolution
17891+
unless \tcode{uses_allocator_v<container_type, Alloc>} is \tcode{true}.
17892+
1788517893
\indexlibraryctor{flat_multiset}%
1788617894
\begin{itemdecl}
17887-
template<class Allocator>
17888-
flat_multiset(const container_type& cont, const Allocator& a);
17889-
template<class Allocator>
17890-
flat_multiset(const container_type& cont, const key_compare& comp, const Allocator& a);
17895+
template<class Alloc>
17896+
flat_multiset(const container_type& cont, const Alloc& a);
17897+
template<class Alloc>
17898+
flat_multiset(const container_type& cont, const key_compare& comp, const Alloc& a);
1789117899
\end{itemdecl}
1789217900

1789317901
\begin{itemdescr}
17894-
\pnum
17895-
\constraints
17896-
\tcode{uses_allocator_v<container_type, Allocator>} is \tcode{true}.
17897-
1789817902
\pnum
1789917903
\effects
1790017904
Equivalent to \tcode{flat_multiset(cont)} and
@@ -17910,18 +17914,14 @@
1791017914

1791117915
\indexlibraryctor{flat_multiset}%
1791217916
\begin{itemdecl}
17913-
template<class Allocator>
17914-
flat_multiset(sorted_equivalent_t s, const container_type& cont, const Allocator& a);
17915-
template<class Allocator>
17917+
template<class Alloc>
17918+
flat_multiset(sorted_equivalent_t s, const container_type& cont, const Alloc& a);
17919+
template<class Alloc>
1791617920
flat_multiset(sorted_equivalent_t s, const container_type& cont,
1791717921
const key_compare& comp, const Allocator& a);
1791817922
\end{itemdecl}
1791917923

1792017924
\begin{itemdescr}
17921-
\pnum
17922-
\constraints
17923-
\tcode{uses_allocator_v<container_type, Allocator>} is \tcode{true}.
17924-
1792517925
\pnum
1792617926
\effects
1792717927
Equivalent to \tcode{flat_multiset(s, cont)} and
@@ -17936,44 +17936,40 @@
1793617936

1793717937
\indexlibraryctor{flat_multiset}%
1793817938
\begin{itemdecl}
17939-
template<class Allocator>
17940-
flat_multiset(const flat_multiset&, const Allocator& a);
17941-
template<class Allocator>
17942-
flat_multiset(flat_multiset&&, const Allocator& a);
17943-
template<class Allocator>
17944-
flat_multiset(const key_compare& comp, const Allocator& a);
17945-
template<class Allocator>
17946-
explicit flat_multiset(const Allocator& a);
17947-
template<class InputIterator, class Allocator>
17939+
template<class Alloc>
17940+
flat_multiset(const flat_multiset&, const Alloc& a);
17941+
template<class Alloc>
17942+
flat_multiset(flat_multiset&&, const Alloc& a);
17943+
template<class Alloc>
17944+
flat_multiset(const key_compare& comp, const Alloc& a);
17945+
template<class Alloc>
17946+
explicit flat_multiset(const Alloc& a);
17947+
template<class InputIterator, class Alloc>
1794817948
flat_multiset(InputIterator first, InputIterator last,
17949-
const key_compare& comp, const Allocator& a);
17950-
template<class InputIterator, class Allocator>
17951-
flat_multiset(InputIterator first, InputIterator last, const Allocator& a);
17952-
template<@\exposconcept{container-compatible-range}@<value_type> R, class Allocator>
17953-
flat_multiset(from_range_t, R&& rg, const Allocator& a);
17954-
template<@\exposconcept{container-compatible-range}@<value_type> R, class Allocator>
17955-
flat_multiset(from_range_t, R&& rg, const key_compare& comp, const Allocator& a);
17956-
template<class InputIterator, class Allocator>
17949+
const key_compare& comp, const Alloc& a);
17950+
template<class InputIterator, class Alloc>
17951+
flat_multiset(InputIterator first, InputIterator last, const Alloc& a);
17952+
template<@\exposconcept{container-compatible-range}@<value_type> R, class Alloc>
17953+
flat_multiset(from_range_t, R&& rg, const Alloc& a);
17954+
template<@\exposconcept{container-compatible-range}@<value_type> R, class Alloc>
17955+
flat_multiset(from_range_t, R&& rg, const key_compare& comp, const Alloc& a);
17956+
template<class InputIterator, class Alloc>
1795717957
flat_multiset(sorted_equivalent_t, InputIterator first, InputIterator last,
17958-
const key_compare& comp, const Allocator& a);
17959-
template<class InputIterator, class Allocator>
17960-
flat_multiset(sorted_equivalent_t, InputIterator first, InputIterator last, const Allocator& a);
17961-
template<class Allocator>
17962-
flat_multiset(initializer_list<value_type> il, const key_compare& comp, const Allocator& a);
17963-
template<class Allocator>
17964-
flat_multiset(initializer_list<value_type> il, const Allocator& a);
17965-
template<class Allocator>
17958+
const key_compare& comp, const Alloc& a);
17959+
template<class InputIterator, class Alloc>
17960+
flat_multiset(sorted_equivalent_t, InputIterator first, InputIterator last, const Alloc& a);
17961+
template<class Alloc>
17962+
flat_multiset(initializer_list<value_type> il, const key_compare& comp, const Alloc& a);
17963+
template<class Alloc>
17964+
flat_multiset(initializer_list<value_type> il, const Alloc& a);
17965+
template<class Alloc>
1796617966
flat_multiset(sorted_equivalent_t, initializer_list<value_type> il,
17967-
const key_compare& comp, const Allocator& a);
17968-
template<class Allocator>
17969-
flat_multiset(sorted_equivalent_t, initializer_list<value_type> il, const Allocator& a);
17967+
const key_compare& comp, const Alloc& a);
17968+
template<class Alloc>
17969+
flat_multiset(sorted_equivalent_t, initializer_list<value_type> il, const Alloc& a);
1797017970
\end{itemdecl}
1797117971

1797217972
\begin{itemdescr}
17973-
\pnum
17974-
\constraints
17975-
\tcode{uses_allocator_v<container_type, Allocator>} is \tcode{true}.
17976-
1797717973
\pnum
1797817974
\effects
1797917975
Equivalent to the corresponding non-allocator constructors

0 commit comments

Comments
 (0)