Skip to content

Commit

Permalink
[flat.set] P2767R0 section 3 as seen by LWG
Browse files Browse the repository at this point in the history
Modified to resolve the merge conflict with LWG3884 (03da5ba).
  • Loading branch information
Quuxplusone committed May 19, 2024
1 parent f5954d5 commit 347408e
Showing 1 changed file with 85 additions and 89 deletions.
174 changes: 85 additions & 89 deletions source/containers.tex
Original file line number Diff line number Diff line change
Expand Up @@ -16957,79 +16957,81 @@
// \ref{flat.set.cons}, constructors
flat_set() : flat_set(key_compare()) { }

template<class Allocator>
flat_set(const flat_set&, const Allocator& a);
template<class Allocator>
flat_set(flat_set&&, const Allocator& a);

explicit flat_set(container_type cont, const key_compare& comp = key_compare());
template<class Allocator>
flat_set(const container_type& cont, const Allocator& a);
template<class Allocator>
flat_set(const container_type& cont, const key_compare& comp, const Allocator& a);

flat_set(sorted_unique_t, container_type cont, const key_compare& comp = key_compare())
: @\exposid{c}@(std::move(cont)), @\exposid{compare}@(comp) { }
template<class Allocator>
flat_set(sorted_unique_t, const container_type& cont, const Allocator& a);
template<class Allocator>
flat_set(sorted_unique_t, const container_type& cont,
const key_compare& comp, const Allocator& a);

explicit flat_set(const key_compare& comp)
: @\exposid{c}@(), @\exposid{compare}@(comp) { }
template<class Allocator>
flat_set(const key_compare& comp, const Allocator& a);
template<class Allocator>
explicit flat_set(const Allocator& a);

template<class InputIterator>
flat_set(InputIterator first, InputIterator last, const key_compare& comp = key_compare())
: @\exposid{c}@(), @\exposid{compare}@(comp)
{ insert(first, last); }
template<class InputIterator, class Allocator>
flat_set(InputIterator first, InputIterator last,
const key_compare& comp, const Allocator& a);
template<class InputIterator, class Allocator>
flat_set(InputIterator first, InputIterator last, const Allocator& a);

template<@\exposconcept{container-compatible-range}@<value_type> R>
flat_set(from_range_t fr, R&& rg)
: flat_set(fr, std::forward<R>(rg), key_compare()) { }
template<@\exposconcept{container-compatible-range}@<value_type> R, class Allocator>
flat_set(from_range_t, R&& rg, const Allocator& a);
template<@\exposconcept{container-compatible-range}@<value_type> R>
flat_set(from_range_t, R&& rg, const key_compare& comp)
: flat_set(comp)
{ insert_range(std::forward<R>(rg)); }
template<@\exposconcept{container-compatible-range}@<value_type> R, class Allocator>
flat_set(from_range_t, R&& rg, const key_compare& comp, const Allocator& a);

template<class InputIterator>
flat_set(sorted_unique_t, InputIterator first, InputIterator last,
const key_compare& comp = key_compare())
: @\exposid{c}@(first, last), @\exposid{compare}@(comp) { }
template<class InputIterator, class Allocator>
flat_set(sorted_unique_t, InputIterator first, InputIterator last,
const key_compare& comp, const Allocator& a);
template<class InputIterator, class Allocator>
flat_set(sorted_unique_t, InputIterator first, InputIterator last, const Allocator& a);

flat_set(initializer_list<value_type> il, const key_compare& comp = key_compare())
: flat_set(il.begin(), il.end(), comp) { }
template<class Allocator>
flat_set(initializer_list<value_type> il, const key_compare& comp, const Allocator& a);
template<class Allocator>
flat_set(initializer_list<value_type> il, const Allocator& a);

flat_set(sorted_unique_t s, initializer_list<value_type> il,
const key_compare& comp = key_compare())
: flat_set(s, il.begin(), il.end(), comp) { }
template<class Allocator>

// \ref{flat.set.cons.alloc}, constructors with allocators

template<class Alloc>
flat_set(const flat_set&, const Alloc& a);
template<class Alloc>
flat_set(flat_set&&, const Alloc& a);
template<class Alloc>
flat_set(const container_type& cont, const Alloc& a);
template<class Alloc>
flat_set(const container_type& cont, const key_compare& comp, const Alloc& a);
template<class Alloc>
flat_set(sorted_unique_t, const container_type& cont, const Alloc& a);
template<class Alloc>
flat_set(sorted_unique_t, const container_type& cont,
const key_compare& comp, const Alloc& a);
template<class Alloc>
flat_set(const key_compare& comp, const Alloc& a);
template<class Alloc>
explicit flat_set(const Alloc& a);
template<class InputIterator, class Alloc>
flat_set(InputIterator first, InputIterator last,
const key_compare& comp, const Alloc& a);
template<class InputIterator, class Alloc>
flat_set(InputIterator first, InputIterator last, const Alloc& a);
template<@\exposconcept{container-compatible-range}@<value_type> R, class Alloc>
flat_set(from_range_t, R&& rg, const Alloc& a);
template<@\exposconcept{container-compatible-range}@<value_type> R, class Alloc>
flat_set(from_range_t, R&& rg, const key_compare& comp, const Alloc& a);
template<class InputIterator, class Alloc>
flat_set(sorted_unique_t, InputIterator first, InputIterator last,
const key_compare& comp, const Alloc& a);
template<class InputIterator, class Alloc>
flat_set(sorted_unique_t, InputIterator first, InputIterator last, const Alloc& a);
template<class Alloc>
flat_set(initializer_list<value_type> il, const key_compare& comp, const Alloc& a);
template<class Alloc>
flat_set(initializer_list<value_type> il, const Alloc& a);
template<class Alloc>
flat_set(sorted_unique_t, initializer_list<value_type> il,
const key_compare& comp, const Allocator& a);
template<class Allocator>
flat_set(sorted_unique_t, initializer_list<value_type> il, const Allocator& a);
const key_compare& comp, const Alloc& a);
template<class Alloc>
flat_set(sorted_unique_t, initializer_list<value_type> il, const Alloc& a);

flat_set& operator=(initializer_list<value_type>);

Expand Down Expand Up @@ -17214,23 +17216,25 @@

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

\rSec3[flat.set.cons.alloc]{Constructors with allocators}

\pnum
The constructors in this subclause shall not participate in overload resolution
unless \tcode{uses_allocator_v<container_type, Alloc>} is \tcode{true}.

\indexlibraryctor{flat_set}%
\begin{itemdecl}
template<class Allocator>
flat_set(const container_type& cont, const Allocator& a);
template<class Allocator>
flat_set(const container_type& cont, const key_compare& comp, const Allocator& a);
template<class Alloc>
flat_set(const container_type& cont, const Alloc& a);
template<class Alloc>
flat_set(const container_type& cont, const key_compare& comp, const Alloc& a);
\end{itemdecl}

\begin{itemdescr}
\pnum
\constraints
\tcode{uses_allocator_v<container_type, Allocator>} is \tcode{true}.

\pnum
\effects
Equivalent to
Expand All @@ -17245,18 +17249,14 @@

\indexlibraryctor{flat_set}%
\begin{itemdecl}
template<class Allocator>
flat_set(sorted_unique_t s, const container_type& cont, const Allocator& a);
template<class Allocator>
template<class Alloc>
flat_set(sorted_unique_t s, const container_type& cont, const Alloc& a);
template<class Alloc>
flat_set(sorted_unique_t s, const container_type& cont,
const key_compare& comp, const Allocator& a);
const key_compare& comp, const Alloc& a);
\end{itemdecl}

\begin{itemdescr}
\pnum
\constraints
\tcode{uses_allocator_v<container_type, Allocator>} is \tcode{true}.

\pnum
\effects
Equivalent to
Expand All @@ -17271,43 +17271,39 @@

\indexlibraryctor{flat_set}%
\begin{itemdecl}
template<class Allocator>
flat_set(const flat_set&, const Allocator& a);
template<class Allocator>
flat_set(flat_set&&, const Allocator& a);
template<class Allocator>
flat_set(const key_compare& comp, const Allocator& a);
template<class Allocator>
explicit flat_set(const Allocator& a);
template<class InputIterator, class Allocator>
flat_set(InputIterator first, InputIterator last, const key_compare& comp, const Allocator& a);
template<class InputIterator, class Allocator>
flat_set(InputIterator first, InputIterator last, const Allocator& a);
template<@\exposconcept{container-compatible-range}@<value_type> R, class Allocator>
flat_set(from_range_t, R&& rg, const Allocator& a);
template<@\exposconcept{container-compatible-range}@<value_type> R, class Allocator>
flat_set(from_range_t, R&& rg, const key_compare& comp, const Allocator& a);
template<class InputIterator, class Allocator>
template<class Alloc>
flat_set(const flat_set&, const Alloc& a);
template<class Alloc>
flat_set(flat_set&&, const Alloc& a);
template<class Alloc>
flat_set(const key_compare& comp, const Alloc& a);
template<class Alloc>
explicit flat_set(const Alloc& a);
template<class InputIterator, class Alloc>
flat_set(InputIterator first, InputIterator last, const key_compare& comp, const Alloc& a);
template<class InputIterator, class Alloc>
flat_set(InputIterator first, InputIterator last, const Alloc& a);
template<@\exposconcept{container-compatible-range}@<value_type> R, class Alloc>
flat_set(from_range_t, R&& rg, const Alloc& a);
template<@\exposconcept{container-compatible-range}@<value_type> R, class Alloc>
flat_set(from_range_t, R&& rg, const key_compare& comp, const Alloc& a);
template<class InputIterator, class Alloc>
flat_set(sorted_unique_t, InputIterator first, InputIterator last,
const key_compare& comp, const Allocator& a);
template<class InputIterator, class Allocator>
flat_set(sorted_unique_t, InputIterator first, InputIterator last, const Allocator& a);
template<class Allocator>
flat_set(initializer_list<value_type> il, const key_compare& comp, const Allocator& a);
template<class Allocator>
flat_set(initializer_list<value_type> il, const Allocator& a);
template<class Allocator>
const key_compare& comp, const Alloc& a);
template<class InputIterator, class Alloc>
flat_set(sorted_unique_t, InputIterator first, InputIterator last, const Alloc& a);
template<class Alloc>
flat_set(initializer_list<value_type> il, const key_compare& comp, const Alloc& a);
template<class Alloc>
flat_set(initializer_list<value_type> il, const Alloc& a);
template<class Alloc>
flat_set(sorted_unique_t, initializer_list<value_type> il,
const key_compare& comp, const Allocator& a);
template<class Allocator>
flat_set(sorted_unique_t, initializer_list<value_type> il, const Allocator& a);
const key_compare& comp, const Alloc& a);
template<class Alloc>
flat_set(sorted_unique_t, initializer_list<value_type> il, const Alloc& a);
\end{itemdecl}

\begin{itemdescr}
\pnum
\constraints
\tcode{uses_allocator_v<container_type, Allocator>} is \tcode{true}.

\pnum
\effects
Equivalent to the corresponding non-allocator constructors
Expand Down

0 comments on commit 347408e

Please sign in to comment.