Skip to content

[Motion lwg 1] P2910R0 C++ Standard Library Issues #6335

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Jul 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 38 additions & 4 deletions source/containers.tex
Original file line number Diff line number Diff line change
Expand Up @@ -2176,8 +2176,8 @@
\tcode{reference; const_reference} for constant \tcode{a}

\pnum
\returns
\tcode{*(a.begin() + n)}
\effects
Equivalent to: \tcode{return *(a.begin() + n);}

\pnum
\remarks
Expand Down Expand Up @@ -14758,6 +14758,11 @@
// \ref{flat.map.cons}, construct/copy/destroy
flat_map() : flat_map(key_compare()) { }

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

flat_map(key_container_type key_cont, mapped_container_type mapped_cont,
const key_compare& comp = key_compare());
template<class Allocator>
Expand Down Expand Up @@ -15166,6 +15171,10 @@

\indexlibraryctor{flat_map}%
\begin{itemdecl}
template<class Allocator>
flat_map(const flat_map&, const Allocator& a);
template<class Allocator>
flat_map(flat_map&&, const Allocator& a);
template<class Allocator>
flat_map(const key_compare& comp, const Allocator& a);
template<class Allocator>
Expand Down Expand Up @@ -15938,6 +15947,11 @@
// \ref{flat.multimap.cons}, construct/copy/destroy
flat_multimap() : flat_multimap(key_compare()) { }

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

flat_multimap(key_container_type key_cont, mapped_container_type mapped_cont,
const key_compare& comp = key_compare());
template<class Allocator>
Expand Down Expand Up @@ -16308,6 +16322,10 @@

\indexlibraryctor{flat_multimap}%
\begin{itemdecl}
template<class Allocator>
flat_multimap(const flat_multimap&, const Allocator& a);
template<class Allocator>
flat_multimap(flat_multimap&&, const Allocator& a);
template<class Allocator>
flat_multimap(const key_compare& comp, const Allocator& a);
template<class Allocator>
Expand Down Expand Up @@ -16499,6 +16517,11 @@
// \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);
Expand Down Expand Up @@ -16808,6 +16831,10 @@

\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>
Expand Down Expand Up @@ -17153,6 +17180,11 @@
// \ref{flat.multiset.cons}, constructors
flat_multiset() : flat_multiset(key_compare()) { }

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

explicit flat_multiset(container_type cont, const key_compare& comp = key_compare());
template<class Allocator>
flat_multiset(const container_type& cont, const Allocator& a);
Expand Down Expand Up @@ -17464,6 +17496,10 @@

\indexlibraryctor{flat_multiset}%
\begin{itemdecl}
template<class Allocator>
flat_multiset(const flat_multiset&, const Allocator& a);
template<class Allocator>
flat_multiset(flat_multiset&&, const Allocator& a);
template<class Allocator>
flat_multiset(const key_compare& comp, const Allocator& a);
template<class Allocator>
Expand Down Expand Up @@ -17808,8 +17844,6 @@
template<class OtherElementType, size_t OtherExtent>
constexpr explicit(@\seebelow@) span(const span<OtherElementType, OtherExtent>& s) noexcept;

~span() noexcept = default;

constexpr span& operator=(const span& other) noexcept = default;

// \ref{span.sub}, subviews
Expand Down
1 change: 1 addition & 0 deletions source/lib-intro.tex
Original file line number Diff line number Diff line change
Expand Up @@ -2968,6 +2968,7 @@
\item \indexlibraryzombie{argument_type} \tcode{argument_type},
\item \indexlibraryzombie{first_argument_type} \tcode{first_argument_type},
\item \indexlibraryzombie{io_state} \tcode{io_state},
\item \indexlibraryzombie{op} \tcode{op},
\item \indexlibraryzombie{open_mode} \tcode{open_mode},
\item \indexlibraryzombie{preferred} \tcode{preferred},
\item \indexlibraryzombie{second_argument_type} \tcode{second_argument_type},
Expand Down
19 changes: 18 additions & 1 deletion source/numerics.tex
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
namespace std {
// types
using fenv_t = @\textit{object type}@;
using fexcept_t = @\textit{integer type}@;
using fexcept_t = @\textit{object type}@;

// functions
int feclearexcept(int except);
Expand Down Expand Up @@ -500,6 +500,23 @@
\tcode{*this}.
\end{itemdescr}

\indexlibrarymember{operator=}{complex}%
\begin{itemdecl}
template<class X> constexpr complex& operator=(const complex<X>& rhs);
\end{itemdecl}

\begin{itemdescr}
\pnum
\effects
Assigns the value \tcode{rhs.real()} to the real part and
the value \tcode{rhs.imag()} to the imaginary part
of the complex value \tcode{*this}.

\pnum
\returns
\tcode{*this}.
\end{itemdescr}

\indexlibrarymember{operator+=}{complex}%
\begin{itemdecl}
template<class X> constexpr complex& operator+=(const complex<X>& rhs);
Expand Down
25 changes: 9 additions & 16 deletions source/ranges.tex
Original file line number Diff line number Diff line change
Expand Up @@ -433,8 +433,8 @@
}

// \ref{range.enumerate}, enumerate view
template<@\libconcept{input_range}@ View>
requires @\libconcept{view}@<View>
template<@\libconcept{view}@ V>
requires @\seebelow@
class enumerate_view; // freestanding

template<class View>
Expand Down Expand Up @@ -1265,14 +1265,6 @@
\end{itemdecl}

\begin{itemdescr}
\pnum
The required expressions
\tcode{ranges::begin(t)}
and
\tcode{ranges::end(t)}
of the \libconcept{range} concept
do not require implicit expression variations\iref{concepts.equality}.

\pnum
Given an expression \tcode{t} such that \tcode{decltype((t))} is \tcode{T\&},
\tcode{T} models \libconcept{range} only if
Expand Down Expand Up @@ -7803,8 +7795,9 @@
\begin{itemdescr}
\pnum
\effects
Initializes \exposid{parent_} with \tcode{i.\exposid{parent_}} and
\exposid{current_} with \tcode{std::move(i.\exposid{current_})}.
Initializes \exposid{parent_} with \tcode{i.\exposid{parent_}},
\exposid{current_} with \tcode{std::move(i.\exposid{current_})}, and
\exposid{trailing_empty_} with \tcode{i.\exposid{trailing_empty_}}.
\end{itemdescr}

\indexlibrarymember{operator*}{lazy_split_view::\exposid{outer-iterator}}%
Expand Down Expand Up @@ -9633,7 +9626,7 @@
requires @\libconcept{random_access_range}@<@\exposid{Base}@>;
friend constexpr @\exposid{iterator}@ operator-(const @\exposid{iterator}@& x, difference_type y)
requires @\libconcept{random_access_range}@<@\exposid{Base}@>;
friend constexpr difference_type operator-(const @\exposid{iterator}@& x, const @\exposid{iterator}@& y);
friend constexpr difference_type operator-(const @\exposid{iterator}@& x, const @\exposid{iterator}@& y) noexcept;

friend constexpr auto iter_move(const @\exposid{iterator}@& i)
noexcept(noexcept(ranges::iter_move(i.@\exposid{current_}@)) &&
Expand Down Expand Up @@ -9900,7 +9893,7 @@

\indexlibrarymember{operator-}{enumerate_view::\exposid{iterator}}%
\begin{itemdecl}
friend constexpr difference_type operator-(const @\exposid{iterator}@& x, const @\exposid{iterator}@& y);
friend constexpr difference_type operator-(const @\exposid{iterator}@& x, const @\exposid{iterator}@& y) noexcept;
\end{itemdecl}

\begin{itemdescr}
Expand Down Expand Up @@ -15957,7 +15950,7 @@

template<ranges::@\libconcept{input_range}@ R, class Alloc>
requires @\libconcept{convertible_to}@<ranges::range_reference_t<R>, yielded>
auto yield_value(ranges::elements_of<R, Alloc> r) noexcept;
auto yield_value(ranges::elements_of<R, Alloc> r);

void await_transform() = delete;

Expand Down Expand Up @@ -16121,7 +16114,7 @@
\begin{itemdecl}
template<ranges::@\libconcept{input_range}@ R, class Alloc>
requires @\libconcept{convertible_to}@<ranges::range_reference_t<R>, yielded>
auto yield_value(ranges::elements_of<R, Alloc> r) noexcept;
auto yield_value(ranges::elements_of<R, Alloc> r);
\end{itemdecl}

\begin{itemdescr}
Expand Down
6 changes: 3 additions & 3 deletions source/strings.tex
Original file line number Diff line number Diff line change
Expand Up @@ -2368,9 +2368,7 @@
function or operator has no other effect on the \tcode{basic_string} object.

\pnum
In every specialization \tcode{basic_string<charT, traits, Allocator>},
the type \tcode{allocator_traits<All\-ocator>::value_type} shall name the same type
as \tcode{charT}. Every object of type
Every object of type
\tcode{basic_string<charT, traits, Allocator>} uses an object of type
\tcode{Allocator} to allocate and free storage for the contained \tcode{charT}
objects as needed. The \tcode{Allocator} object used is
Expand All @@ -2383,6 +2381,8 @@
an allocator-aware container,
but does not use the allocator's \tcode{construct} and \tcode{destroy}
member functions\iref{container.requirements.pre}.
The program is ill-formed if
\tcode{Allocator::value_type} is not the same type as \tcode{charT}.
\end{note}
\begin{note}
The program is ill-formed if \tcode{traits::char_type}
Expand Down
12 changes: 12 additions & 0 deletions source/threads.tex
Original file line number Diff line number Diff line change
Expand Up @@ -4905,6 +4905,7 @@
operator shared_ptr<T>() const noexcept;
void store(shared_ptr<T> desired, memory_order order = memory_order::seq_cst) noexcept;
void operator=(shared_ptr<T> desired) noexcept;
void operator=(nullptr_t) noexcept;

shared_ptr<T> exchange(shared_ptr<T> desired,
memory_order order = memory_order::seq_cst) noexcept;
Expand Down Expand Up @@ -4991,6 +4992,17 @@
Equivalent to \tcode{store(desired)}.
\end{itemdescr}

\indexlibrarymember{operator=}{atomic<shared_ptr<T>>}%
\begin{itemdecl}
void operator=(nullptr_t) noexcept;
\end{itemdecl}

\begin{itemdescr}
\pnum
\effects
Equivalent to \tcode{store(nullptr)}.
\end{itemdescr}

\indexlibrarymember{load}{atomic<shared_ptr<T>>}%
\begin{itemdecl}
shared_ptr<T> load(memory_order order = memory_order::seq_cst) const noexcept;
Expand Down
Loading