Skip to content

Commit

Permalink
Merge 2022-07 LWG Motion 1
Browse files Browse the repository at this point in the history
P2618R0 C++ Standard Library Issues
  • Loading branch information
tkoeppe committed Aug 11, 2022
2 parents c831e97 + cdd04d6 commit 6cce010
Show file tree
Hide file tree
Showing 13 changed files with 144 additions and 177 deletions.
8 changes: 8 additions & 0 deletions source/algorithms.tex
Original file line number Diff line number Diff line change
Expand Up @@ -6206,6 +6206,7 @@
\end{note}

\pnum
\indexdefn{sequence!sorted!with respect to a comparator and projection}%
A sequence is \term{sorted with respect to a \tcode{comp} and \tcode{proj}}
for a comparator and projection \tcode{comp} and \tcode{proj}
if for every iterator \tcode{i} pointing to the sequence and
Expand All @@ -6217,6 +6218,13 @@
\end{codeblock}
is \tcode{false}.

\pnum
\indexdefn{sequence!sorted!with respect to a comparator}%
A sequence is \term{sorted with respect to a comparator} \tcode{comp}
for a comparator \tcode{comp}
if it is sorted with respect to
\tcode{comp} and \tcode{identity\{\}} (the identity projection).

\pnum
A sequence \range{start}{finish} is
\term{partitioned with respect to an expression} \tcode{f(e)}
Expand Down
12 changes: 8 additions & 4 deletions source/containers.tex
Original file line number Diff line number Diff line change
Expand Up @@ -10515,7 +10515,8 @@
insert_return_type insert(node_type&& nh);
iterator insert(const_iterator hint, node_type&& nh);

iterator erase(iterator position);
iterator erase(iterator position)
requires (!@\libconcept{same_as}@<iterator, const_iterator>);
iterator erase(const_iterator position);
size_type erase(const key_type& x);
template<class K> size_type erase(K&& x);
Expand Down Expand Up @@ -10827,7 +10828,8 @@
iterator insert(node_type&& nh);
iterator insert(const_iterator hint, node_type&& nh);

iterator erase(iterator position);
iterator erase(iterator position)
requires (!@\libconcept{same_as}@<iterator, const_iterator>);
iterator erase(const_iterator position);
size_type erase(const key_type& x);
template<class K> size_type erase(K&& x);
Expand Down Expand Up @@ -12359,7 +12361,8 @@
insert_return_type insert(node_type&& nh);
iterator insert(const_iterator hint, node_type&& nh);

iterator erase(iterator position);
iterator erase(iterator position)
requires (!@\libconcept{same_as}@<iterator, const_iterator>);
iterator erase(const_iterator position);
size_type erase(const key_type& k);
template<class K> size_type erase(K&& x);
Expand Down Expand Up @@ -12732,7 +12735,8 @@
iterator insert(node_type&& nh);
iterator insert(const_iterator hint, node_type&& nh);

iterator erase(iterator position);
iterator erase(iterator position)
requires (!@\libconcept{same_as}@<iterator, const_iterator>);
iterator erase(const_iterator position);
size_type erase(const key_type& k);
template<class K> size_type erase(K&& x);
Expand Down
24 changes: 0 additions & 24 deletions source/future.tex
Original file line number Diff line number Diff line change
Expand Up @@ -2639,8 +2639,6 @@
void atomic_init(atomic<T>*, typename atomic<T>::value_type) noexcept;

#define ATOMIC_VAR_INIT(value) @\seebelow@

#define ATOMIC_FLAG_INIT @\seebelow@
}
\end{codeblock}

Expand Down Expand Up @@ -2709,25 +2707,3 @@
\end{codeblock}
\end{example}
\end{itemdescr}

\rSec2[depr.atomics.flag]{Flag type and operations}

\indexlibraryglobal{ATOMIC_FLAG_INIT}%
\begin{itemdecl}
#define ATOMIC_FLAG_INIT @\seebelow@
\end{itemdecl}

\begin{itemdescr}
\pnum
\remarks
The macro \tcode{ATOMIC_FLAG_INIT} is defined in such a way that
it can be used to initialize an object of type \tcode{atomic_flag}
to the clear state.
The macro can be used in the form:
\begin{codeblock}
atomic_flag guard = ATOMIC_FLAG_INIT;
\end{codeblock}
It is unspecified whether the macro can be used
in other initialization contexts.
For a complete static-duration object, that initialization shall be static.
\end{itemdescr}
8 changes: 8 additions & 0 deletions source/iostreams.tex
Original file line number Diff line number Diff line change
Expand Up @@ -15757,6 +15757,10 @@
directory_iterator& operator++();
directory_iterator& increment(error_code& ec);

bool operator==(default_sentinel_t) const noexcept {
return *this == directory_iterator();
}

// other members as required by \ref{input.iterators}, input iterators
};
}
Expand Down Expand Up @@ -16003,6 +16007,10 @@
void pop(error_code& ec);
void disable_recursion_pending();

bool operator==(default_sentinel_t) const noexcept {
return *this == recursive_directory_iterator();
}

// other members as required by \ref{input.iterators}, input iterators
};
}
Expand Down
4 changes: 2 additions & 2 deletions source/iterators.tex
Original file line number Diff line number Diff line change
Expand Up @@ -4796,7 +4796,7 @@
constexpr decltype(auto) operator*();
constexpr decltype(auto) operator*() const
requires @\exposconcept{dereferenceable}@<const I>;
constexpr decltype(auto) operator->() const
constexpr auto operator->() const
requires @\seebelow@;

constexpr common_iterator& operator++();
Expand Down Expand Up @@ -4964,7 +4964,7 @@

\indexlibrarymember{operator->}{common_iterator}%
\begin{itemdecl}
constexpr decltype(auto) operator->() const
constexpr auto operator->() const
requires @\seebelow@;
\end{itemdecl}

Expand Down
8 changes: 5 additions & 3 deletions source/lib-intro.tex
Original file line number Diff line number Diff line change
Expand Up @@ -492,9 +492,11 @@
\indexlibrary{decay-copy@\tcode{\placeholder{decay-copy}}}%
\begin{codeblock}
namespace std {
template<class T> constexpr decay_t<T> @\placeholdernc{decay-copy}@(T&& v)
noexcept(is_nothrow_convertible_v<T, decay_t<T>>) // \expos
{ return std::forward<T>(v); }
template<class T>
requires @\libconcept{convertible_to}@<T, decay_t<T>>
constexpr decay_t<T> @\placeholdernc{decay-copy}@(T&& v)
noexcept(is_nothrow_convertible_v<T, decay_t<T>>) // \expos
{ return std::forward<T>(v); }

constexpr auto @\placeholdernc{synth-three-way}@ =
[]<class T, class U>(const T& t, const U& u)
Expand Down
6 changes: 6 additions & 0 deletions source/memory.tex
Original file line number Diff line number Diff line change
Expand Up @@ -5442,6 +5442,12 @@
polymorphic_allocator select_on_container_copy_construction() const;

memory_resource* resource() const;

// friends
friend bool operator==(const polymorphic_allocator& a,
const polymorphic_allocator& b) noexcept {
return *a.resource() == *b.resource();
}
};
}
\end{codeblock}
Expand Down

0 comments on commit 6cce010

Please sign in to comment.