438
438
namespace views { inline constexpr @\unspec@ chunk_by = @\unspec@ ; }
439
439
440
440
// \ref {range.stride }, stride view
441
- template<input_range V>
441
+ template<@ \libconcept { input_range}@ V>
442
442
requires @\libconcept {view}@<V>
443
443
class stride_view;
444
444
12898
12898
\rSec 3[range.stride.overview]{Overview}
12899
12899
12900
12900
\pnum
12901
- \tcode {stride_view} presents a view of an underlying sequence,
12901
+ \tcode {stride_view} presents a \libconcept { view} of an underlying sequence,
12902
12902
advancing over $ n$ elements at a time,
12903
12903
as opposed to the usual single-step succession.
12904
12904
12927
12927
class stride_view : public view_interface<stride_view<V>> {
12928
12928
V @\exposid {base_}@; // \expos
12929
12929
range_difference_t<V> @\exposid {stride_}@; // \expos
12930
+ // \ref {range.stride.iterator }, class template \tcode {stride_view::\exposid {iterator}}
12930
12931
template<bool> class @\exposid {iterator}@; // \expos
12931
12932
public:
12932
12933
constexpr explicit stride_view(V base, range_difference_t<V> stride);
@@ -12940,34 +12941,34 @@
12940
12941
return @\exposid {iterator}@<false>(this, ranges::begin(@\exposid {base_}@));
12941
12942
}
12942
12943
12943
- constexpr auto begin() const requires range<const V> {
12944
+ constexpr auto begin() const requires @ \libconcept { range}@ <const V> {
12944
12945
return @\exposid {iterator}@<true>(this, ranges::begin(@\exposid {base_}@));
12945
12946
}
12946
12947
12947
12948
constexpr auto end() requires (!@\exposconcept {simple-view}@<V>) {
12948
- if constexpr (common_range<V> && sized_range<V> && forward_range<V>) {
12949
+ if constexpr (@ \libconcept { common_range}@ <V> && @ \libconcept { sized_range}@ <V> && @ \libconcept { forward_range}@ <V>) {
12949
12950
auto missing = (@\exposid {stride_}@ - ranges::distance(@\exposid {base_}@) % @\exposid{stride_}@) % @\exposid{stride_}@;
12950
12951
return @\exposid {iterator}@<false>(this, ranges::end(@\exposid {base_}@), missing);
12951
- } else if constexpr (common_range<V> && !bidirectional_range<V>) {
12952
+ } else if constexpr (@ \libconcept { common_range}@ <V> && !@ \libconcept { bidirectional_range}@ <V>) {
12952
12953
return @\exposid {iterator}@<false>(this, ranges::end(@\exposid {base_}@));
12953
12954
} else {
12954
12955
return default_sentinel;
12955
12956
}
12956
12957
}
12957
12958
12958
- constexpr auto end() const requires range<const V> {
12959
- if constexpr (common_range<const V> && sized_range<const V> && forward_range<const V>) {
12959
+ constexpr auto end() const requires @ \libconcept { range}@ <const V> {
12960
+ if constexpr (@ \libconcept { common_range}@ <const V> && @ \libconcept { sized_range}@ <const V> && @ \libconcept { forward_range}@ <const V>) {
12960
12961
auto missing = (@\exposid {stride_}@ - ranges::distance(@\exposid {base_}@) % @\exposid{stride_}@) % @\exposid{stride_}@;
12961
12962
return @\exposid {iterator}@<true>(this, ranges::end(@\exposid {base_}@), missing);
12962
- } else if constexpr (common_range<const V> && !bidirectional_range<const V>) {
12963
+ } else if constexpr (@ \libconcept { common_range}@ <const V> && !@ \libconcept { bidirectional_range}@ <const V>) {
12963
12964
return @\exposid {iterator}@<true>(this, ranges::end(@\exposid {base_}@));
12964
12965
} else {
12965
12966
return default_sentinel;
12966
12967
}
12967
12968
}
12968
12969
12969
- constexpr auto size() requires sized_range<V>;
12970
- constexpr auto size() const requires sized_range<const V>;
12970
+ constexpr auto size() requires @ \libconcept { sized_range}@ <V>;
12971
+ constexpr auto size() const requires @ \libconcept { sized_range}@ <const V>;
12971
12972
};
12972
12973
12973
12974
template<class R>
@@ -13002,10 +13003,10 @@
13002
13003
\exposid {stride_}.
13003
13004
\end {itemdescr }
13004
13005
13005
- \indexlibrarymember {stride }{stride_view}%
13006
+ \indexlibrarymember {size }{stride_view}%
13006
13007
\begin {itemdecl }
13007
- constexpr auto size() requires sized_range<V>;
13008
- constexpr auto size() const requires sized_range<const V>;
13008
+ constexpr auto size() requires @ \libconcept { sized_range}@ <V>;
13009
+ constexpr auto size() const requires @ \libconcept { sized_range}@ <const V>;
13009
13010
\end {itemdecl }
13010
13011
13011
13012
\begin {itemdescr }
@@ -13041,11 +13042,11 @@
13041
13042
using iterator_concept = @\seebelow@ ;
13042
13043
using iterator_category = @\seebelow@ ; // not always present
13043
13044
13044
- iterator() requires default_initializable<iterator_t<@\exposid {Base}@>> = default;
13045
+ iterator() requires @ \libconcept { default_initializable}@ <iterator_t<@\exposid {Base}@>> = default;
13045
13046
13046
13047
constexpr @\exposid {iterator}@(@\exposid {iterator}@<!Const> other)
13047
- requires Const && convertible_to<iterator_t<V>, iterator_t<@\exposid {Base}@>>
13048
- && convertible_to<sentinel_t<V>, sentinel_t<@\exposid {Base}@>>;
13048
+ requires Const && @ \libconcept { convertible_to}@ <iterator_t<V>, iterator_t<@\exposid {Base}@>>
13049
+ && @ \libconcept { convertible_to}@ <sentinel_t<V>, sentinel_t<@\exposid {Base}@>>;
13049
13050
13050
13051
constexpr iterator_t<@\exposid {Base}@> base() &&;
13051
13052
constexpr const iterator_t<@\exposid {Base}@>& base() const & noexcept;
13069
13070
friend constexpr bool operator==(const @\exposid {iterator}@& x, default_sentinel_t);
13070
13071
13071
13072
friend constexpr bool operator==(const @\exposid {iterator}@& x, const @\exposid {iterator}@& y)
13072
- requires equality_comparable<iterator_t<@\exposid {Base}@>>;
13073
+ requires @ \libconcept { equality_comparable}@ <iterator_t<@\exposid {Base}@>>;
13073
13074
13074
13075
friend constexpr bool operator<(const @\exposid {iterator}@& x, const @\exposid {iterator}@& y)
13075
13076
requires @\libconcept {random_access_range}@<@\exposid {Base}@>;
13145
13146
13146
13147
\indexlibraryctor {stride_view::iterator}%
13147
13148
\begin {itemdecl }
13148
- constexpr @\exposid {iterator}@(Parent* parent, iterator_t<@\exposid {Base}@> current,
13149
+ constexpr @\exposid {iterator}@(@ \exposid { Parent}@ * parent, iterator_t<@\exposid {Base}@> current,
13149
13150
range_difference_t<@\exposid {Base}@> missing = 0);
13150
13151
\end {itemdecl }
13151
13152
13204
13205
\begin {itemdescr }
13205
13206
\pnum
13206
13207
\expects
13207
- \exposid {current_} != \exposid {end_} is \tcode {true}.
13208
+ \tcode { \ exposid {current_} != \exposid {end_} } is \tcode {true}.
13208
13209
13209
13210
\pnum
13210
13211
\effects
13252
13253
\effects
13253
13254
Equivalent to:
13254
13255
\begin {codeblock }
13255
- ranges::advance(current_, missing_ - stride_);
13256
- missing_ = 0;
13256
+ ranges::advance(@ \exposid { current_}@, @ \exposid { missing_}@ - @ \exposid { stride_}@ );
13257
+ @ \exposid { missing_}@ = 0;
13257
13258
return *this;
13258
13259
\end {codeblock }
13259
13260
\end {itemdescr }
13286
13287
\tcode {ranges::distance(\exposid {current_}, \exposid {end_}) > \exposid {stride_} * (n - 1)}
13287
13288
is \tcode {true}.
13288
13289
\begin {note }
13289
- If \tcode {n} is negative, the \effects paragraph implies a precondition.
13290
+ If \tcode {n} is negative, the \Fundescx {Effects} paragraph implies a precondition.
13290
13291
\end {note }
13291
13292
13292
13293
\pnum
13395
13396
\begin {itemdescr }
13396
13397
\pnum
13397
13398
\returns
13398
- \tcode {x.current_ <=> y.current_}.
13399
+ \tcode {x.\exposid { current_} <=> y.\exposid { current_} }.
13399
13400
\end {itemdescr }
13400
13401
13401
13402
\indexlibrarymember {operator+}{stride_view::iterator}%
13443
13444
\begin {itemdescr }
13444
13445
\pnum
13445
13446
\returns
13446
- Let \tcode {N} be \tcode {x.\exposid {current_} - y.\exposid {current_}}.
13447
+ Let \tcode {N} be \tcode {( x.\exposid {current_} - y.\exposid {current_}) }.
13447
13448
\begin {itemize }
13448
13449
\item
13449
13450
If \exposid {Base} models \libconcept {forward_range},
0 commit comments