Skip to content

Commit 6cce010

Browse files
authored
Merge 2022-07 LWG Motion 1
P2618R0 C++ Standard Library Issues
2 parents c831e97 + cdd04d6 commit 6cce010

13 files changed

+144
-177
lines changed

source/algorithms.tex

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6206,6 +6206,7 @@
62066206
\end{note}
62076207

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

6221+
\pnum
6222+
\indexdefn{sequence!sorted!with respect to a comparator}%
6223+
A sequence is \term{sorted with respect to a comparator} \tcode{comp}
6224+
for a comparator \tcode{comp}
6225+
if it is sorted with respect to
6226+
\tcode{comp} and \tcode{identity\{\}} (the identity projection).
6227+
62206228
\pnum
62216229
A sequence \range{start}{finish} is
62226230
\term{partitioned with respect to an expression} \tcode{f(e)}

source/containers.tex

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10515,7 +10515,8 @@
1051510515
insert_return_type insert(node_type&& nh);
1051610516
iterator insert(const_iterator hint, node_type&& nh);
1051710517

10518-
iterator erase(iterator position);
10518+
iterator erase(iterator position)
10519+
requires (!@\libconcept{same_as}@<iterator, const_iterator>);
1051910520
iterator erase(const_iterator position);
1052010521
size_type erase(const key_type& x);
1052110522
template<class K> size_type erase(K&& x);
@@ -10827,7 +10828,8 @@
1082710828
iterator insert(node_type&& nh);
1082810829
iterator insert(const_iterator hint, node_type&& nh);
1082910830

10830-
iterator erase(iterator position);
10831+
iterator erase(iterator position)
10832+
requires (!@\libconcept{same_as}@<iterator, const_iterator>);
1083110833
iterator erase(const_iterator position);
1083210834
size_type erase(const key_type& x);
1083310835
template<class K> size_type erase(K&& x);
@@ -12359,7 +12361,8 @@
1235912361
insert_return_type insert(node_type&& nh);
1236012362
iterator insert(const_iterator hint, node_type&& nh);
1236112363

12362-
iterator erase(iterator position);
12364+
iterator erase(iterator position)
12365+
requires (!@\libconcept{same_as}@<iterator, const_iterator>);
1236312366
iterator erase(const_iterator position);
1236412367
size_type erase(const key_type& k);
1236512368
template<class K> size_type erase(K&& x);
@@ -12732,7 +12735,8 @@
1273212735
iterator insert(node_type&& nh);
1273312736
iterator insert(const_iterator hint, node_type&& nh);
1273412737

12735-
iterator erase(iterator position);
12738+
iterator erase(iterator position)
12739+
requires (!@\libconcept{same_as}@<iterator, const_iterator>);
1273612740
iterator erase(const_iterator position);
1273712741
size_type erase(const key_type& k);
1273812742
template<class K> size_type erase(K&& x);

source/future.tex

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2639,8 +2639,6 @@
26392639
void atomic_init(atomic<T>*, typename atomic<T>::value_type) noexcept;
26402640

26412641
#define ATOMIC_VAR_INIT(value) @\seebelow@
2642-
2643-
#define ATOMIC_FLAG_INIT @\seebelow@
26442642
}
26452643
\end{codeblock}
26462644

@@ -2709,25 +2707,3 @@
27092707
\end{codeblock}
27102708
\end{example}
27112709
\end{itemdescr}
2712-
2713-
\rSec2[depr.atomics.flag]{Flag type and operations}
2714-
2715-
\indexlibraryglobal{ATOMIC_FLAG_INIT}%
2716-
\begin{itemdecl}
2717-
#define ATOMIC_FLAG_INIT @\seebelow@
2718-
\end{itemdecl}
2719-
2720-
\begin{itemdescr}
2721-
\pnum
2722-
\remarks
2723-
The macro \tcode{ATOMIC_FLAG_INIT} is defined in such a way that
2724-
it can be used to initialize an object of type \tcode{atomic_flag}
2725-
to the clear state.
2726-
The macro can be used in the form:
2727-
\begin{codeblock}
2728-
atomic_flag guard = ATOMIC_FLAG_INIT;
2729-
\end{codeblock}
2730-
It is unspecified whether the macro can be used
2731-
in other initialization contexts.
2732-
For a complete static-duration object, that initialization shall be static.
2733-
\end{itemdescr}

source/iostreams.tex

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15757,6 +15757,10 @@
1575715757
directory_iterator& operator++();
1575815758
directory_iterator& increment(error_code& ec);
1575915759

15760+
bool operator==(default_sentinel_t) const noexcept {
15761+
return *this == directory_iterator();
15762+
}
15763+
1576015764
// other members as required by \ref{input.iterators}, input iterators
1576115765
};
1576215766
}
@@ -16003,6 +16007,10 @@
1600316007
void pop(error_code& ec);
1600416008
void disable_recursion_pending();
1600516009

16010+
bool operator==(default_sentinel_t) const noexcept {
16011+
return *this == recursive_directory_iterator();
16012+
}
16013+
1600616014
// other members as required by \ref{input.iterators}, input iterators
1600716015
};
1600816016
}

source/iterators.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4796,7 +4796,7 @@
47964796
constexpr decltype(auto) operator*();
47974797
constexpr decltype(auto) operator*() const
47984798
requires @\exposconcept{dereferenceable}@<const I>;
4799-
constexpr decltype(auto) operator->() const
4799+
constexpr auto operator->() const
48004800
requires @\seebelow@;
48014801

48024802
constexpr common_iterator& operator++();
@@ -4964,7 +4964,7 @@
49644964

49654965
\indexlibrarymember{operator->}{common_iterator}%
49664966
\begin{itemdecl}
4967-
constexpr decltype(auto) operator->() const
4967+
constexpr auto operator->() const
49684968
requires @\seebelow@;
49694969
\end{itemdecl}
49704970

source/lib-intro.tex

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -492,9 +492,11 @@
492492
\indexlibrary{decay-copy@\tcode{\placeholder{decay-copy}}}%
493493
\begin{codeblock}
494494
namespace std {
495-
template<class T> constexpr decay_t<T> @\placeholdernc{decay-copy}@(T&& v)
496-
noexcept(is_nothrow_convertible_v<T, decay_t<T>>) // \expos
497-
{ return std::forward<T>(v); }
495+
template<class T>
496+
requires @\libconcept{convertible_to}@<T, decay_t<T>>
497+
constexpr decay_t<T> @\placeholdernc{decay-copy}@(T&& v)
498+
noexcept(is_nothrow_convertible_v<T, decay_t<T>>) // \expos
499+
{ return std::forward<T>(v); }
498500

499501
constexpr auto @\placeholdernc{synth-three-way}@ =
500502
[]<class T, class U>(const T& t, const U& u)

source/memory.tex

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5442,6 +5442,12 @@
54425442
polymorphic_allocator select_on_container_copy_construction() const;
54435443

54445444
memory_resource* resource() const;
5445+
5446+
// friends
5447+
friend bool operator==(const polymorphic_allocator& a,
5448+
const polymorphic_allocator& b) noexcept {
5449+
return *a.resource() == *b.resource();
5450+
}
54455451
};
54465452
}
54475453
\end{codeblock}

0 commit comments

Comments
 (0)