Skip to content

Commit a5db8f8

Browse files
authored
Merge 2024-06 LWG Motion 1
P3341R0 C++ Standard Library Ready Issues to be moved in St. Louis
2 parents af9e678 + 7b8cb07 commit a5db8f8

File tree

5 files changed

+76
-52
lines changed

5 files changed

+76
-52
lines changed

source/algorithms.tex

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4682,7 +4682,8 @@
46824682
\returns
46834683
\tcode{false} if $\tcode{N1} < \tcode{N2}$, otherwise
46844684
\begin{codeblock}
4685-
ranges::equal(views::drop(ranges::ref_view(r1), N1 - N2), r2, pred, proj1, proj2)
4685+
ranges::equal(views::drop(ranges::ref_view(r1), N1 - static_cast<decltype(N1)>(N2)),
4686+
r2, pred, proj1, proj2)
46864687
\end{codeblock}
46874688
\end{itemdescr}
46884689

source/containers.tex

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23392,7 +23392,13 @@
2339223392
is \tcode{true}.
2339323393

2339423394
\pnum
23395-
Let \tcode{offset} be a value of type \tcode{size_t} equal to
23395+
If \tcode{\exposid{first_}<index_type, $k$>(slices...)}
23396+
equals \tcode{extents().extent($k$)}
23397+
for any rank index $k$ of \tcode{extents()}, then
23398+
let \tcode{offset} be a value of type \tcode{size_t} equal to
23399+
\tcode{(*this).required_span_size()}.
23400+
Otherwise,
23401+
let \tcode{offset} be a value of type \tcode{size_t} equal to
2339623402
\tcode{(*this)(\exposid{first_}<index_type, P>(slices...)...)}.
2339723403

2339823404
\rSec5[mdspan.sub.map.left]{\tcode{layout_left} specialization of \tcode{submdspan_mapping}}
@@ -23840,9 +23846,9 @@
2384023846
\effects
2384123847
Equivalent to:
2384223848
\begin{codeblock}
23843-
auto sub_map_offset = submdspan_mapping(src.mapping(), slices...);
23844-
return mdspan(src.accessor().offset(src.data(), sub_map_offset.offset),
23845-
sub_map_offset.mapping,
23849+
auto sub_map_result = submdspan_mapping(src.mapping(), slices...);
23850+
return mdspan(src.accessor().offset(src.data(), sub_map_result.offset),
23851+
sub_map_result.mapping,
2384623852
AccessorPolicy::offset_policy(src.accessor()));
2384723853
\end{codeblock}
2384823854
\end{itemdescr}

source/ranges.tex

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -334,13 +334,8 @@
334334
namespace views { inline constexpr @\unspecnc@ join = @\unspecnc@; } // freestanding
335335

336336
// \ref{range.join.with}, join with view
337-
template<class R, class P>
338-
concept @\exposconcept{compatible-joinable-ranges}@ = @\seebelow@; // \expos
339-
340337
template<@\libconcept{input_range}@ V, @\libconcept{forward_range}@ Pattern>
341-
requires @\libconcept{view}@<V> && @\libconcept{input_range}@<range_reference_t<V>>
342-
&& @\libconcept{view}@<Pattern>
343-
&& @\exposconcept{compatible-joinable-ranges}@<range_reference_t<V>, Pattern>
338+
requires @\seebelow@
344339
class join_with_view; // freestanding
345340

346341
namespace views { inline constexpr @\unspecnc@ join_with = @\unspecnc@; } // freestanding
@@ -369,9 +364,9 @@
369364
// \ref{range.concat}, concat view
370365
template<@\libconcept{input_range}@... Views>
371366
requires @\seebelow@
372-
class concat_view;
367+
class concat_view; // freestanding
373368

374-
namespace views { inline constexpr @\unspecnc@ concat = @\unspecnc@; }
369+
namespace views { inline constexpr @\unspecnc@ concat = @\unspecnc@; } // freestanding
375370

376371
// \ref{range.counted}, counted view
377372
namespace views { inline constexpr @\unspecnc@ counted = @\unspecnc@; } // freestanding
@@ -2668,7 +2663,8 @@
26682663
Given subexpressions \tcode{E} and \tcode{F}, the expressions
26692664
\tcode{views::iota(E)} and \tcode{views::iota(E, F)}
26702665
are expression-equivalent to
2671-
\tcode{iota_view(E)} and \tcode{iota_view(E, F)}, respectively.
2666+
\tcode{iota_view<decay_t<decltype((E))>>(E)} and \tcode{iota_view(E, F)},
2667+
respectively.
26722668

26732669
\pnum
26742670
\begin{example}
@@ -4520,7 +4516,9 @@
45204516
The expression \tcode{views::as_rvalue(E)} is expression-equivalent to:
45214517
\begin{itemize}
45224518
\item
4523-
\tcode{views::all(E)} if \tcode{\libconcept{same_as}<range_rvalue_reference_t<T>, range_reference_t<T>>} is \tcode{true}.
4519+
\tcode{views::all(E)} if
4520+
\tcode{T} models \libconcept{input_range} and
4521+
\tcode{\libconcept{same_as}<range_rvalue_reference_t<T>, range_reference_t<T>>} is \tcode{true}.
45244522
\item
45254523
Otherwise, \tcode{as_rvalue_view(E)}.
45264524
\end{itemize}
@@ -7023,19 +7021,13 @@
70237021

70247022
\begin{codeblock}
70257023
namespace std::ranges {
7026-
template<class R, class P>
7027-
concept @\defexposconcept{compatible-joinable-ranges}@ = // \expos
7028-
@\libconcept{common_with}@<range_value_t<R>, range_value_t<P>> &&
7029-
@\libconcept{common_reference_with}@<range_reference_t<R>, range_reference_t<P>> &&
7030-
@\libconcept{common_reference_with}@<range_rvalue_reference_t<R>, range_rvalue_reference_t<P>>;
7031-
70327024
template<class R>
70337025
concept @\defexposconcept{bidirectional-common}@ = @\libconcept{bidirectional_range}@<R> && @\libconcept{common_range}@<R>; // \expos
70347026

70357027
template<@\libconcept{input_range}@ V, @\libconcept{forward_range}@ Pattern>
70367028
requires @\libconcept{view}@<V> && @\libconcept{input_range}@<range_reference_t<V>>
70377029
&& @\libconcept{view}@<Pattern>
7038-
&& @\exposconcept{compatible-joinable-ranges}@<range_reference_t<V>, Pattern>
7030+
&& @\exposconcept{concatable}@<range_reference_t<V>, Pattern>
70397031
class join_with_view : public view_interface<join_with_view<V, Pattern>> {
70407032
using @\exposid{InnerRng}@ = range_reference_t<V>; // \expos
70417033

@@ -7081,7 +7073,8 @@
70817073
requires @\libconcept{forward_range}@<const V> &&
70827074
@\libconcept{forward_range}@<const Pattern> &&
70837075
is_reference_v<range_reference_t<const V>> &&
7084-
@\libconcept{input_range}@<range_reference_t<const V>> {
7076+
@\libconcept{input_range}@<range_reference_t<const V>> &&
7077+
@\exposconcept{concatable}@<range_reference_t<const V>, const Pattern> {
70857078
return @\exposid{iterator}@<true>{*this, ranges::begin(@\exposid{base_}@)};
70867079
}
70877080

@@ -7096,7 +7089,8 @@
70967089
constexpr auto end() const
70977090
requires @\libconcept{forward_range}@<const V> && @\libconcept{forward_range}@<const Pattern> &&
70987091
is_reference_v<range_reference_t<const V>> &&
7099-
@\libconcept{input_range}@<range_reference_t<const V>> {
7092+
@\libconcept{input_range}@<range_reference_t<const V>> &&
7093+
@\exposconcept{concatable}@<range_reference_t<const V>, const Pattern> {
71007094
using InnerConstRng = range_reference_t<const V>;
71017095
if constexpr (@\libconcept{forward_range}@<InnerConstRng> &&
71027096
@\libconcept{common_range}@<const V> && @\libconcept{common_range}@<InnerConstRng>)
@@ -7146,7 +7140,7 @@
71467140
namespace std::ranges {
71477141
template<@\libconcept{input_range}@ V, @\libconcept{forward_range}@ Pattern>
71487142
requires @\libconcept{view}@<V> && @\libconcept{input_range}@<range_reference_t<V>>
7149-
&& @\libconcept{view}@<Pattern> && @\exposconcept{compatible-joinable-ranges}@<range_reference_t<V>, Pattern>
7143+
&& @\libconcept{view}@<Pattern> && @\exposconcept{concatable}@<range_reference_t<V>, Pattern>
71507144
template<bool Const>
71517145
class join_with_view<V, Pattern>::@\exposid{iterator}@ {
71527146
using @\exposid{Parent}@ = @\exposid{maybe-const}@<Const, join_with_view>; // \expos
@@ -7553,7 +7547,7 @@
75537547
namespace std::ranges {
75547548
template<@\libconcept{input_range}@ V, @\libconcept{forward_range}@ Pattern>
75557549
requires @\libconcept{view}@<V> && @\libconcept{input_range}@<range_reference_t<V>>
7556-
&& @\libconcept{view}@<Pattern> && @\exposconcept{compatible-joinable-ranges}@<range_reference_t<V>, Pattern>
7550+
&& @\libconcept{view}@<Pattern> && @\exposconcept{concatable}@<range_reference_t<V>, Pattern>
75577551
template<bool Const>
75587552
class join_with_view<V, Pattern>::@\exposid{sentinel}@ {
75597553
using @\exposid{Parent}@ = @\exposid{maybe-const}@<Const, join_with_view>; // \expos
@@ -8483,7 +8477,8 @@
84838477
Given a pack of subexpressions \tcode{Es...},
84848478
the expression \tcode{views::concat(Es...)} is expression-equivalent to
84858479
\begin{itemize}
8486-
\item \tcode{views::all(Es...)} if \tcode{Es} is a pack with only one element,
8480+
\item \tcode{views::all(Es...)} if \tcode{Es} is a pack with only one element
8481+
whose type models \libconcept{input_range},
84878482
\item otherwise, \tcode{concat_view(Es...)}.
84888483
\end{itemize}
84898484
\begin{example}
@@ -8987,6 +8982,10 @@
89878982
\end{itemdecl}
89888983

89898984
\begin{itemdescr}
8985+
\pnum
8986+
\expects
8987+
\tcode{it.\exposid{it_}.valueless_by_exception()} is \tcode{false}.
8988+
89908989
\pnum
89918990
\effects
89928991
Initializes \exposid{parent_} with \tcode{it.\exposid{parent_}}, and
@@ -12242,7 +12241,8 @@
1224212241
\begin{itemize}
1224312242
\item
1224412243
\tcode{((void)E, auto(views::empty<tuple<>>))}
12245-
if \tcode{N} is equal to \tcode{0},
12244+
if \tcode{N} is equal to \tcode{0} and
12245+
\tcode{decltype((E))} models \libconcept{forward_range},
1224612246
\item
1224712247
otherwise, \tcode{adjacent_view<views::all_t<decltype((E))>, N>(E)}.
1224812248
\end{itemize}
@@ -12875,7 +12875,8 @@
1287512875
a constant expression \tcode{N}:
1287612876
\begin{itemize}
1287712877
\item
12878-
If \tcode{N} is equal to \tcode{0},
12878+
If \tcode{N} is equal to \tcode{0} and
12879+
\tcode{decltype((E))} models \libconcept{forward_range},
1287912880
\tcode{views::adjacent_transform<N>(E, F)} is expression-equivalent to
1288012881
\tcode{((void)E, views::zip_transform(F))},
1288112882
except that the evaluations of \tcode{E} and \tcode{F} are

source/support.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -738,7 +738,7 @@
738738
#define @\defnlibxname{cpp_lib_ranges_cartesian_product}@ 202207L // freestanding, also in \libheader{ranges}
739739
#define @\defnlibxname{cpp_lib_ranges_chunk}@ 202202L // freestanding, also in \libheader{ranges}
740740
#define @\defnlibxname{cpp_lib_ranges_chunk_by}@ 202202L // freestanding, also in \libheader{ranges}
741-
#define @\defnlibxname{cpp_lib_ranges_concat}@ 202403L // also in \libheader{ranges}
741+
#define @\defnlibxname{cpp_lib_ranges_concat}@ 202403L // freestanding, also in \libheader{ranges}
742742
#define @\defnlibxname{cpp_lib_ranges_contains}@ 202207L // also in \libheader{algorithm}
743743
#define @\defnlibxname{cpp_lib_ranges_enumerate}@ 202302L // also in \libheader{ranges}
744744
#define @\defnlibxname{cpp_lib_ranges_find_last}@ 202207L // also in \libheader{algorithm}

source/utilities.tex

Lines changed: 38 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -11003,10 +11003,9 @@
1100311003
friend constexpr bool operator==(reference_wrapper, const T&);
1100411004
friend constexpr bool operator==(reference_wrapper, reference_wrapper<const T>);
1100511005

11006-
friend constexpr @\exposidnc{synth-three-way-result}@<T> operator<=>(reference_wrapper, reference_wrapper);
11007-
friend constexpr @\exposidnc{synth-three-way-result}@<T> operator<=>(reference_wrapper, const T&);
11008-
friend constexpr @\exposidnc{synth-three-way-result}@<T> operator<=>(reference_wrapper,
11009-
reference_wrapper<const T>);
11006+
friend constexpr auto operator<=>(reference_wrapper, reference_wrapper);
11007+
friend constexpr auto operator<=>(reference_wrapper, const T&);
11008+
friend constexpr auto operator<=>(reference_wrapper, reference_wrapper<const T>);
1101011009
};
1101111010

1101211011
template<class T>
@@ -11183,34 +11182,45 @@
1118311182
\end{itemdescr}
1118411183

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

1118911188
\begin{itemdescr}
11189+
\pnum
11190+
\constraints
11191+
The expression \tcode{\exposid{synth-three-way}(x.get(), y.get())}
11192+
is well-formed.
11193+
1119011194
\pnum
1119111195
\returns
1119211196
\tcode{\exposid{synth-three-way}(x.get(), y.get())}.
1119311197
\end{itemdescr}
1119411198

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

1119911203
\begin{itemdescr}
11204+
\pnum
11205+
\constraints
11206+
The expression \tcode{\exposid{synth-three-way}(x.get(), y)}
11207+
is well-formed.
11208+
1120011209
\pnum
1120111210
\returns
1120211211
\tcode{\exposid{synth-three-way}(x.get(), y)}.
1120311212
\end{itemdescr}
1120411213

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

1121011218
\begin{itemdescr}
1121111219
\pnum
1121211220
\constraints
1121311221
\tcode{is_const_v<T>} is \tcode{false}.
11222+
The expression \tcode{\exposid{synth-three-way}(x.get(), y.get())}
11223+
is well-formed.
1121411224

1121511225
\pnum
1121611226
\returns
@@ -17147,11 +17157,27 @@
1714717157
\end{codeblock}
1714817158
\begin{note}
1714917159
Specializations such as \tcode{formatter<wchar_t, char>}
17150-
and \tcode{formatter<const char*, wchar_t>}
1715117160
that would require implicit
1715217161
multibyte / wide string or character conversion are disabled.
1715317162
\end{note}
1715417163

17164+
\pnum
17165+
The header \libheaderdef{format} provides
17166+
the following disabled specializations:
17167+
\begin{itemize}
17168+
\item
17169+
The string type specializations
17170+
\begin{codeblock}
17171+
template<> struct formatter<char*, wchar_t>;
17172+
template<> struct formatter<const char*, wchar_t>;
17173+
template<size_t N> struct formatter<char[N], wchar_t>;
17174+
template<class traits, class Allocator>
17175+
struct formatter<basic_string<char, traits, Allocator>, wchar_t>;
17176+
template<class traits>
17177+
struct formatter<basic_string_view<char, traits>, wchar_t>;
17178+
\end{codeblock}
17179+
\end{itemize}
17180+
1715517181
\pnum
1715617182
For any types \tcode{T} and \tcode{charT} for which
1715717183
neither the library nor the user provides
@@ -17604,6 +17630,9 @@
1760417630
basic_format_args<basic_format_context> args_; // \expos
1760517631
Out out_; // \expos
1760617632

17633+
basic_format_context(const basic_format_context&) = delete;
17634+
basic_format_context& operator=(const basic_format_context&) = delete;
17635+
1760717636
public:
1760817637
using iterator = Out;
1760917638
using char_type = charT;
@@ -18622,8 +18651,6 @@
1862218651
const basic_format_arg<Context>* data_; // \expos
1862318652

1862418653
public:
18625-
basic_format_args() noexcept;
18626-
1862718654
template<class... Args>
1862818655
basic_format_args(const @\exposid{format-arg-store}@<Context, Args...>& store) noexcept;
1862918656

@@ -18646,17 +18673,6 @@
1864618673
and packing the former.
1864718674
\end{note}
1864818675

18649-
\indexlibraryctor{basic_format_args}%
18650-
\begin{itemdecl}
18651-
basic_format_args() noexcept;
18652-
\end{itemdecl}
18653-
18654-
\begin{itemdescr}
18655-
\pnum
18656-
\effects
18657-
Initializes \tcode{size_} with \tcode{0}.
18658-
\end{itemdescr}
18659-
1866018676
\indexlibraryctor{basic_format_args}%
1866118677
\begin{itemdecl}
1866218678
template<class... Args>

0 commit comments

Comments
 (0)