Skip to content

Commit cb00449

Browse files
jensmaurertkoeppe
authored andcommitted
P2367R0 Remove misuses of list-initialization from Clause 24
Also fixes LWG3524. Reconciled with Motion 20 (P2210R2) to apply changes to both lazy_split_view and split_view.
1 parent fc053d1 commit cb00449

File tree

1 file changed

+32
-24
lines changed

1 file changed

+32
-24
lines changed

source/ranges.tex

Lines changed: 32 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1670,8 +1670,8 @@
16701670
Equivalent to:
16711671
\begin{itemize}
16721672
\item If \exposid{StoreSize} is \tcode{true},
1673-
\tcode{subrange\{r, ranges::size(r)\}}.
1674-
\item Otherwise, \tcode{subrange\{ranges::begin(r), ranges::end(r)\}}.
1673+
\tcode{subrange(r, ranges::size(r))}.
1674+
\item Otherwise, \tcode{subrange(ranges::begin(r), ranges::end(r))}.
16751675
\end{itemize}
16761676
\end{itemdescr}
16771677

@@ -1963,7 +1963,7 @@
19631963
customization point object\iref{customization.point.object}.
19641964
Given a subexpression \tcode{E}, the expression
19651965
\tcode{views::single(E)} is expression-equivalent to
1966-
\tcode{single_view\{E\}}.
1966+
\tcode{single_view<decay_t<decltype((E))>>(E)}.
19671967

19681968
\pnum
19691969
\begin{example}
@@ -2000,6 +2000,9 @@
20002000
constexpr T* data() noexcept;
20012001
constexpr const T* data() const noexcept;
20022002
};
2003+
2004+
template<class T>
2005+
single_view(T) -> single_view<T>;
20032006
}
20042007
\end{codeblock}
20052008

@@ -2101,7 +2104,7 @@
21012104
Given subexpressions \tcode{E} and \tcode{F}, the expressions
21022105
\tcode{views::iota(E)} and \tcode{views::iota(E, F)}
21032106
are expression-equivalent to
2104-
\tcode{iota_view\{E\}} and \tcode{iota_view\{E, F\}}, respectively.
2107+
\tcode{iota_view(E)} and \tcode{iota_view(E, F)}, respectively.
21052108

21062109
\pnum
21072110
\begin{example}
@@ -3344,7 +3347,7 @@
33443347
range adaptor object\iref{range.adaptor.object}.
33453348
Given subexpressions \tcode{E} and \tcode{P},
33463349
the expression \tcode{views::filter(E, P)} is expression-equivalent to
3347-
\tcode{filter_view\{E, P\}}.
3350+
\tcode{filter_view(E, P)}.
33483351

33493352
\pnum
33503353
\begin{example}
@@ -3765,7 +3768,7 @@
37653768
range adaptor object\iref{range.adaptor.object}.
37663769
Given subexpressions \tcode{E} and \tcode{F}, the expression
37673770
\tcode{views::transform(E, F)} is expression-equivalent to
3768-
\tcode{transform_view\{E, F\}}.
3771+
\tcode{transform_view(E, F)}.
37693772

37703773
\pnum
37713774
\begin{example}
@@ -4459,7 +4462,9 @@
44594462
\item
44604463
If \tcode{T} is a specialization
44614464
of \tcode{ranges::empty_view}\iref{range.empty.view},
4462-
then \tcode{((void) F, \placeholdernc{decay-copy}(E))}.
4465+
then \tcode{((void) F, \placeholdernc{decay-copy}(E))},
4466+
except that the evaluations of \tcode{E} and \tcode{F}
4467+
are indeterminately sequenced.
44634468

44644469
\item
44654470
Otherwise, if \tcode{T} models
@@ -4471,11 +4476,11 @@
44714476
\item a specialization of \tcode{ranges::iota_view}\iref{range.iota.view}, or
44724477
\item a specialization of \tcode{ranges::subrange}\iref{range.subrange},
44734478
\end{itemize}
4474-
then \tcode{T\{ranges::begin(E), ranges::begin(E) + min<D>(ranges::size(E), F)\}},
4479+
then \tcode{T(ranges::begin(E), ranges::begin(E) + min<D>(ranges::size(E), F))},
44754480
except that \tcode{E} is evaluated only once.
44764481

44774482
\item
4478-
Otherwise, \tcode{ranges::take_view\{E, F\}}.
4483+
Otherwise, \tcode{ranges::take_view(E, F)}.
44794484
\end{itemize}
44804485

44814486
\pnum
@@ -4517,10 +4522,10 @@
45174522
return ranges::begin(@\exposid{base_}@);
45184523
else {
45194524
auto sz = size();
4520-
return counted_iterator{ranges::begin(@\exposid{base_}@), sz};
4525+
return counted_iterator(ranges::begin(@\exposid{base_}@), sz);
45214526
}
45224527
} else
4523-
return counted_iterator{ranges::begin(@\exposid{base_}@), @\exposid{count_}@};
4528+
return counted_iterator(ranges::begin(@\exposid{base_}@), @\exposid{count_}@);
45244529
}
45254530

45264531
constexpr auto begin() const requires @\libconcept{range}@<const V> {
@@ -4529,10 +4534,10 @@
45294534
return ranges::begin(@\exposid{base_}@);
45304535
else {
45314536
auto sz = size();
4532-
return counted_iterator{ranges::begin(@\exposid{base_}@), sz};
4537+
return counted_iterator(ranges::begin(@\exposid{base_}@), sz);
45334538
}
45344539
} else
4535-
return counted_iterator{ranges::begin(@\exposid{base_}@), @\exposid{count_}@};
4540+
return counted_iterator(ranges::begin(@\exposid{base_}@), @\exposid{count_}@);
45364541
}
45374542

45384543
constexpr auto end() requires (!@\exposconcept{simple-view}@<V>) {
@@ -4680,7 +4685,7 @@
46804685
a range adaptor object\iref{range.adaptor.object}.
46814686
Given subexpressions \tcode{E} and \tcode{F},
46824687
the expression \tcode{views::take_while(E, F)}
4683-
is expression-equivalent to \tcode{take_while_view\{E, F\}}.
4688+
is expression-equivalent to \tcode{take_while_view(E, F)}.
46844689

46854690
\pnum
46864691
\begin{example}
@@ -4868,7 +4873,9 @@
48684873
\item
48694874
If \tcode{T} is a specialization of
48704875
\tcode{ranges::empty_view}\iref{range.empty.view},
4871-
then \tcode{((void) F, \placeholdernc{decay-copy}(E))}.
4876+
then \tcode{((void) F, \placeholdernc{decay-copy}(E))},
4877+
except that the evaluations of \tcode{E} and \tcode{F}
4878+
are indeterminately sequenced.
48724879

48734880
\item
48744881
Otherwise, if \tcode{T} models
@@ -4880,11 +4887,11 @@
48804887
\item a specialization of \tcode{ranges::iota_view}\iref{range.iota.view}, or
48814888
\item a specialization of \tcode{ranges::subrange}\iref{range.subrange},
48824889
\end{itemize}
4883-
then \tcode{T\{ranges::begin(E) + min<D>(ranges::size(E), F), ranges::end(E)\}},
4890+
then \tcode{T(ranges::begin(E) + min<D>(ranges::size(E), F), ranges::end(E))},
48844891
except that \tcode{E} is evaluated only once.
48854892

48864893
\item
4887-
Otherwise, \tcode{ranges::drop_view\{E, F\}}.
4894+
Otherwise, \tcode{ranges::drop_view(E, F)}.
48884895
\end{itemize}
48894896

48904897
\pnum
@@ -5013,7 +5020,7 @@
50135020
denotes a range adaptor object\iref{range.adaptor.object}.
50145021
Given subexpressions \tcode{E} and \tcode{F},
50155022
the expression \tcode{views::drop_while(E, F)}
5016-
is expression-equivalent to \tcode{drop_while_view\{E, F\}}.
5023+
is expression-equivalent to \tcode{drop_while_view(E, F)}.
50175024

50185025
\pnum
50195026
\begin{example}
@@ -5613,7 +5620,7 @@
56135620
range adaptor object\iref{range.adaptor.object}.
56145621
Given subexpressions \tcode{E} and \tcode{F},
56155622
the expression \tcode{views::lazy_split(E, F)} is expression-equivalent to
5616-
\tcode{lazy_split_view\{E, F\}}.
5623+
\tcode{lazy_split_view(E, F)}.
56175624

56185625
\pnum
56195626
\begin{example}
@@ -5730,7 +5737,7 @@
57305737
\pnum
57315738
\effects
57325739
Initializes \exposid{base_} with \tcode{views::all(std::forward<R>(r))}, and
5733-
\exposid{pattern_} with \tcode{single_view\{\brk{}std::move(e)\}}.
5740+
\exposid{pattern_} with \tcode{views::\linebreak single(std::move(e))}.
57345741
\end{itemdescr}
57355742

57365743
\rSec3[range.lazy.split.outer]{Class template \tcode{lazy_split_view::\exposid{outer-iterator}}}
@@ -6238,6 +6245,7 @@
62386245
\exposid{pattern_} with \tcode{std::move(pattern)}.
62396246
\end{itemdescr}
62406247

6248+
\indexlibraryctor{split_view}%
62416249
\begin{itemdecl}
62426250
template<@\libconcept{forward_range}@ R>
62436251
requires @\libconcept{constructible_from}@<V, views::all_t<R>> &&
@@ -6249,7 +6257,7 @@
62496257
\pnum
62506258
\effects
62516259
Initializes \exposid{base_} with \tcode{views::all(std::forward<R>(r))}, and
6252-
\exposid{pattern_} with \tcode{single_view\{std::move(e)\}}.
6260+
\exposid{pattern_} with \tcode{views::\linebreak single(std::move(e))}.
62536261
\end{itemdescr}
62546262

62556263
\begin{itemdecl}
@@ -6475,16 +6483,16 @@
64756483
\begin{itemize}
64766484
\item
64776485
If \tcode{T} models \libconcept{contiguous_iterator},
6478-
then \tcode{span\{to_address(E), static_cast<D>(F)\}}.
6486+
then \tcode{span(to_address(E), static_cast<D>(F))}.
64796487

64806488
\item
64816489
Otherwise, if \tcode{T} models \libconcept{random_access_iterator},
6482-
then \tcode{subrange\{E, E + static_cast<D>(F)\}},
6490+
then \tcode{subrange(E, E + static_cast<D>(F))},
64836491
except that \tcode{E} is evaluated only once.
64846492

64856493
\item
64866494
Otherwise,
6487-
\tcode{subrange\{counted_iterator\{E, F\}, default_sentinel\}}.
6495+
\tcode{subrange(counted_iterator(E, F), default_sentinel)}.
64886496
\end{itemize}
64896497

64906498
\rSec2[range.common]{Common view}

0 commit comments

Comments
 (0)