Skip to content

[LWG motion 1 2024-06] Ready and Tentatively Ready issues in P3341R0 (C++ Standard Library Ready Issues) #7102

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 13 commits into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 2 additions & 1 deletion source/algorithms.tex
Original file line number Diff line number Diff line change
Expand Up @@ -4682,7 +4682,8 @@
\returns
\tcode{false} if $\tcode{N1} < \tcode{N2}$, otherwise
\begin{codeblock}
ranges::equal(views::drop(ranges::ref_view(r1), N1 - N2), r2, pred, proj1, proj2)
ranges::equal(views::drop(ranges::ref_view(r1), N1 - static_cast<decltype(N1)>(N2)),
r2, pred, proj1, proj2)
\end{codeblock}
\end{itemdescr}

Expand Down
14 changes: 10 additions & 4 deletions source/containers.tex
Original file line number Diff line number Diff line change
Expand Up @@ -23392,7 +23392,13 @@
is \tcode{true}.

\pnum
Let \tcode{offset} be a value of type \tcode{size_t} equal to
If \tcode{\exposid{first_}<index_type, $k$>(slices...)}
equals \tcode{extents().extent($k$)}
for any rank index $k$ of \tcode{extents()}, then
let \tcode{offset} be a value of type \tcode{size_t} equal to
\tcode{(*this).required_span_size()}.
Otherwise,
let \tcode{offset} be a value of type \tcode{size_t} equal to
\tcode{(*this)(\exposid{first_}<index_type, P>(slices...)...)}.

\rSec5[mdspan.sub.map.left]{\tcode{layout_left} specialization of \tcode{submdspan_mapping}}
Expand Down Expand Up @@ -23840,9 +23846,9 @@
\effects
Equivalent to:
\begin{codeblock}
auto sub_map_offset = submdspan_mapping(src.mapping(), slices...);
return mdspan(src.accessor().offset(src.data(), sub_map_offset.offset),
sub_map_offset.mapping,
auto sub_map_result = submdspan_mapping(src.mapping(), slices...);
return mdspan(src.accessor().offset(src.data(), sub_map_result.offset),
sub_map_result.mapping,
AccessorPolicy::offset_policy(src.accessor()));
\end{codeblock}
\end{itemdescr}
Expand Down
49 changes: 25 additions & 24 deletions source/ranges.tex
Original file line number Diff line number Diff line change
Expand Up @@ -334,13 +334,8 @@
namespace views { inline constexpr @\unspecnc@ join = @\unspecnc@; } // freestanding

// \ref{range.join.with}, join with view
template<class R, class P>
concept @\exposconcept{compatible-joinable-ranges}@ = @\seebelow@; // \expos

template<@\libconcept{input_range}@ V, @\libconcept{forward_range}@ Pattern>
requires @\libconcept{view}@<V> && @\libconcept{input_range}@<range_reference_t<V>>
&& @\libconcept{view}@<Pattern>
&& @\exposconcept{compatible-joinable-ranges}@<range_reference_t<V>, Pattern>
requires @\seebelow@
class join_with_view; // freestanding

namespace views { inline constexpr @\unspecnc@ join_with = @\unspecnc@; } // freestanding
Expand Down Expand Up @@ -369,9 +364,9 @@
// \ref{range.concat}, concat view
template<@\libconcept{input_range}@... Views>
requires @\seebelow@
class concat_view;
class concat_view; // freestanding

namespace views { inline constexpr @\unspecnc@ concat = @\unspecnc@; }
namespace views { inline constexpr @\unspecnc@ concat = @\unspecnc@; } // freestanding

// \ref{range.counted}, counted view
namespace views { inline constexpr @\unspecnc@ counted = @\unspecnc@; } // freestanding
Expand Down Expand Up @@ -2668,7 +2663,8 @@
Given subexpressions \tcode{E} and \tcode{F}, the expressions
\tcode{views::iota(E)} and \tcode{views::iota(E, F)}
are expression-equivalent to
\tcode{iota_view(E)} and \tcode{iota_view(E, F)}, respectively.
\tcode{iota_view<decay_t<decltype((E))>>(E)} and \tcode{iota_view(E, F)},
respectively.

\pnum
\begin{example}
Expand Down Expand Up @@ -4520,7 +4516,9 @@
The expression \tcode{views::as_rvalue(E)} is expression-equivalent to:
\begin{itemize}
\item
\tcode{views::all(E)} if \tcode{\libconcept{same_as}<range_rvalue_reference_t<T>, range_reference_t<T>>} is \tcode{true}.
\tcode{views::all(E)} if
\tcode{T} models \libconcept{input_range} and
\tcode{\libconcept{same_as}<range_rvalue_reference_t<T>, range_reference_t<T>>} is \tcode{true}.
\item
Otherwise, \tcode{as_rvalue_view(E)}.
\end{itemize}
Expand Down Expand Up @@ -7023,19 +7021,13 @@

\begin{codeblock}
namespace std::ranges {
template<class R, class P>
concept @\defexposconcept{compatible-joinable-ranges}@ = // \expos
@\libconcept{common_with}@<range_value_t<R>, range_value_t<P>> &&
@\libconcept{common_reference_with}@<range_reference_t<R>, range_reference_t<P>> &&
@\libconcept{common_reference_with}@<range_rvalue_reference_t<R>, range_rvalue_reference_t<P>>;

template<class R>
concept @\defexposconcept{bidirectional-common}@ = @\libconcept{bidirectional_range}@<R> && @\libconcept{common_range}@<R>; // \expos

template<@\libconcept{input_range}@ V, @\libconcept{forward_range}@ Pattern>
requires @\libconcept{view}@<V> && @\libconcept{input_range}@<range_reference_t<V>>
&& @\libconcept{view}@<Pattern>
&& @\exposconcept{compatible-joinable-ranges}@<range_reference_t<V>, Pattern>
&& @\exposconcept{concatable}@<range_reference_t<V>, Pattern>
class join_with_view : public view_interface<join_with_view<V, Pattern>> {
using @\exposid{InnerRng}@ = range_reference_t<V>; // \expos

Expand Down Expand Up @@ -7081,7 +7073,8 @@
requires @\libconcept{forward_range}@<const V> &&
@\libconcept{forward_range}@<const Pattern> &&
is_reference_v<range_reference_t<const V>> &&
@\libconcept{input_range}@<range_reference_t<const V>> {
@\libconcept{input_range}@<range_reference_t<const V>> &&
@\exposconcept{concatable}@<range_reference_t<const V>, const Pattern> {
return @\exposid{iterator}@<true>{*this, ranges::begin(@\exposid{base_}@)};
}

Expand All @@ -7096,7 +7089,8 @@
constexpr auto end() const
requires @\libconcept{forward_range}@<const V> && @\libconcept{forward_range}@<const Pattern> &&
is_reference_v<range_reference_t<const V>> &&
@\libconcept{input_range}@<range_reference_t<const V>> {
@\libconcept{input_range}@<range_reference_t<const V>> &&
@\exposconcept{concatable}@<range_reference_t<const V>, const Pattern> {
using InnerConstRng = range_reference_t<const V>;
if constexpr (@\libconcept{forward_range}@<InnerConstRng> &&
@\libconcept{common_range}@<const V> && @\libconcept{common_range}@<InnerConstRng>)
Expand Down Expand Up @@ -7146,7 +7140,7 @@
namespace std::ranges {
template<@\libconcept{input_range}@ V, @\libconcept{forward_range}@ Pattern>
requires @\libconcept{view}@<V> && @\libconcept{input_range}@<range_reference_t<V>>
&& @\libconcept{view}@<Pattern> && @\exposconcept{compatible-joinable-ranges}@<range_reference_t<V>, Pattern>
&& @\libconcept{view}@<Pattern> && @\exposconcept{concatable}@<range_reference_t<V>, Pattern>
template<bool Const>
class join_with_view<V, Pattern>::@\exposid{iterator}@ {
using @\exposid{Parent}@ = @\exposid{maybe-const}@<Const, join_with_view>; // \expos
Expand Down Expand Up @@ -7553,7 +7547,7 @@
namespace std::ranges {
template<@\libconcept{input_range}@ V, @\libconcept{forward_range}@ Pattern>
requires @\libconcept{view}@<V> && @\libconcept{input_range}@<range_reference_t<V>>
&& @\libconcept{view}@<Pattern> && @\exposconcept{compatible-joinable-ranges}@<range_reference_t<V>, Pattern>
&& @\libconcept{view}@<Pattern> && @\exposconcept{concatable}@<range_reference_t<V>, Pattern>
template<bool Const>
class join_with_view<V, Pattern>::@\exposid{sentinel}@ {
using @\exposid{Parent}@ = @\exposid{maybe-const}@<Const, join_with_view>; // \expos
Expand Down Expand Up @@ -8483,7 +8477,8 @@
Given a pack of subexpressions \tcode{Es...},
the expression \tcode{views::concat(Es...)} is expression-equivalent to
\begin{itemize}
\item \tcode{views::all(Es...)} if \tcode{Es} is a pack with only one element,
\item \tcode{views::all(Es...)} if \tcode{Es} is a pack with only one element
whose type models \libconcept{input_range},
\item otherwise, \tcode{concat_view(Es...)}.
\end{itemize}
\begin{example}
Expand Down Expand Up @@ -8987,6 +8982,10 @@
\end{itemdecl}

\begin{itemdescr}
\pnum
\expects
\tcode{it.\exposid{it_}.valueless_by_exception()} is \tcode{false}.

\pnum
\effects
Initializes \exposid{parent_} with \tcode{it.\exposid{parent_}}, and
Expand Down Expand Up @@ -12242,7 +12241,8 @@
\begin{itemize}
\item
\tcode{((void)E, auto(views::empty<tuple<>>))}
if \tcode{N} is equal to \tcode{0},
if \tcode{N} is equal to \tcode{0} and
\tcode{decltype((E))} models \libconcept{forward_range},
\item
otherwise, \tcode{adjacent_view<views::all_t<decltype((E))>, N>(E)}.
\end{itemize}
Expand Down Expand Up @@ -12875,7 +12875,8 @@
a constant expression \tcode{N}:
\begin{itemize}
\item
If \tcode{N} is equal to \tcode{0},
If \tcode{N} is equal to \tcode{0} and
\tcode{decltype((E))} models \libconcept{forward_range},
\tcode{views::adjacent_transform<N>(E, F)} is expression-equivalent to
\tcode{((void)E, views::zip_transform(F))},
except that the evaluations of \tcode{E} and \tcode{F} are
Expand Down
2 changes: 1 addition & 1 deletion source/support.tex
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,7 @@
#define @\defnlibxname{cpp_lib_ranges_cartesian_product}@ 202207L // freestanding, also in \libheader{ranges}
#define @\defnlibxname{cpp_lib_ranges_chunk}@ 202202L // freestanding, also in \libheader{ranges}
#define @\defnlibxname{cpp_lib_ranges_chunk_by}@ 202202L // freestanding, also in \libheader{ranges}
#define @\defnlibxname{cpp_lib_ranges_concat}@ 202403L // also in \libheader{ranges}
#define @\defnlibxname{cpp_lib_ranges_concat}@ 202403L // freestanding, also in \libheader{ranges}
#define @\defnlibxname{cpp_lib_ranges_contains}@ 202207L // also in \libheader{algorithm}
#define @\defnlibxname{cpp_lib_ranges_enumerate}@ 202302L // also in \libheader{ranges}
#define @\defnlibxname{cpp_lib_ranges_find_last}@ 202207L // also in \libheader{algorithm}
Expand Down
60 changes: 38 additions & 22 deletions source/utilities.tex
Original file line number Diff line number Diff line change
Expand Up @@ -11003,10 +11003,9 @@
friend constexpr bool operator==(reference_wrapper, const T&);
friend constexpr bool operator==(reference_wrapper, reference_wrapper<const T>);

friend constexpr @\exposidnc{synth-three-way-result}@<T> operator<=>(reference_wrapper, reference_wrapper);
friend constexpr @\exposidnc{synth-three-way-result}@<T> operator<=>(reference_wrapper, const T&);
friend constexpr @\exposidnc{synth-three-way-result}@<T> operator<=>(reference_wrapper,
reference_wrapper<const T>);
friend constexpr auto operator<=>(reference_wrapper, reference_wrapper);
friend constexpr auto operator<=>(reference_wrapper, const T&);
friend constexpr auto operator<=>(reference_wrapper, reference_wrapper<const T>);
};

template<class T>
Expand Down Expand Up @@ -11183,34 +11182,45 @@
\end{itemdescr}

\begin{itemdecl}
friend constexpr @\exposidnc{synth-three-way-result}@<T> operator<=>(reference_wrapper x, reference_wrapper y);
friend constexpr auto operator<=>(reference_wrapper x, reference_wrapper y);
\end{itemdecl}

\begin{itemdescr}
\pnum
\constraints
The expression \tcode{\exposid{synth-three-way}(x.get(), y.get())}
is well-formed.

\pnum
\returns
\tcode{\exposid{synth-three-way}(x.get(), y.get())}.
\end{itemdescr}

\begin{itemdecl}
friend constexpr @\exposidnc{synth-three-way-result}@<T> operator<=>(reference_wrapper x, const T& y);
friend constexpr auto operator<=>(reference_wrapper x, const T& y);
\end{itemdecl}

\begin{itemdescr}
\pnum
\constraints
The expression \tcode{\exposid{synth-three-way}(x.get(), y)}
is well-formed.

\pnum
\returns
\tcode{\exposid{synth-three-way}(x.get(), y)}.
\end{itemdescr}

\begin{itemdecl}
friend constexpr @\exposidnc{synth-three-way-result}@<T> operator<=>(reference_wrapper x,
reference_wrapper<const T> y);
friend constexpr auto operator<=>(reference_wrapper x, reference_wrapper<const T> y);
\end{itemdecl}

\begin{itemdescr}
\pnum
\constraints
\tcode{is_const_v<T>} is \tcode{false}.
The expression \tcode{\exposid{synth-three-way}(x.get(), y.get())}
is well-formed.

\pnum
\returns
Expand Down Expand Up @@ -17147,11 +17157,27 @@
\end{codeblock}
\begin{note}
Specializations such as \tcode{formatter<wchar_t, char>}
and \tcode{formatter<const char*, wchar_t>}
that would require implicit
multibyte / wide string or character conversion are disabled.
\end{note}

\pnum
The header \libheaderdef{format} provides
the following disabled specializations:
\begin{itemize}
\item
The string type specializations
\begin{codeblock}
template<> struct formatter<char*, wchar_t>;
template<> struct formatter<const char*, wchar_t>;
template<size_t N> struct formatter<char[N], wchar_t>;
template<class traits, class Allocator>
struct formatter<basic_string<char, traits, Allocator>, wchar_t>;
template<class traits>
struct formatter<basic_string_view<char, traits>, wchar_t>;
\end{codeblock}
\end{itemize}

\pnum
For any types \tcode{T} and \tcode{charT} for which
neither the library nor the user provides
Expand Down Expand Up @@ -17604,6 +17630,9 @@
basic_format_args<basic_format_context> args_; // \expos
Out out_; // \expos

basic_format_context(const basic_format_context&) = delete;
basic_format_context& operator=(const basic_format_context&) = delete;

public:
using iterator = Out;
using char_type = charT;
Expand Down Expand Up @@ -18622,8 +18651,6 @@
const basic_format_arg<Context>* data_; // \expos

public:
basic_format_args() noexcept;

template<class... Args>
basic_format_args(const @\exposid{format-arg-store}@<Context, Args...>& store) noexcept;

Expand All @@ -18646,17 +18673,6 @@
and packing the former.
\end{note}

\indexlibraryctor{basic_format_args}%
\begin{itemdecl}
basic_format_args() noexcept;
\end{itemdecl}

\begin{itemdescr}
\pnum
\effects
Initializes \tcode{size_} with \tcode{0}.
\end{itemdescr}

\indexlibraryctor{basic_format_args}%
\begin{itemdecl}
template<class... Args>
Expand Down
Loading