|
85 | 85 | template<class T>
|
86 | 86 | inline constexpr bool enable_view = @\seebelow@;
|
87 | 87 |
|
88 |
| - struct view_base { }; |
| 88 | + struct view_base {}; |
89 | 89 |
|
90 | 90 | template<class T>
|
91 | 91 | concept view = @\seebelow@;
|
|
1638 | 1638 | @\libconcept{convertible_to}@<sentinel_t<R>, S>
|
1639 | 1639 | constexpr subrange(R&& r, @\placeholdernc{make-unsigned-like-t}@<iter_difference_t<I>> n)
|
1640 | 1640 | requires (K == subrange_kind::sized)
|
1641 |
| - : subrange{ranges::begin(r), ranges::end(r), n} |
1642 |
| - {} |
| 1641 | + : subrange{ranges::begin(r), ranges::end(r), n} {} |
1643 | 1642 |
|
1644 | 1643 | template<@\exposconcept{different-from}@<subrange> PairLike>
|
1645 | 1644 | requires @\exposconcept{pair-like-convertible-from}@<PairLike, const I&, const S&>
|
|
1947 | 1946 | namespace std::ranges {
|
1948 | 1947 | struct dangling {
|
1949 | 1948 | constexpr dangling() noexcept = default;
|
1950 |
| - constexpr dangling(auto&&...) noexcept { } |
| 1949 | + constexpr dangling(auto&&...) noexcept {} |
1951 | 1950 | };
|
1952 | 1951 | }
|
1953 | 1952 | \end{codeblock}
|
|
2968 | 2967 | public:
|
2969 | 2968 | constexpr explicit basic_istream_view(basic_istream<CharT, Traits>& stream);
|
2970 | 2969 |
|
2971 |
| - constexpr auto begin() |
2972 |
| - { |
| 2970 | + constexpr auto begin() { |
2973 | 2971 | *@\exposid{stream_}@ >> @\exposid{value_}@;
|
2974 | 2972 | return @\exposid{iterator}@{*this};
|
2975 | 2973 | }
|
|
3215 | 3213 | \begin{codeblock}
|
3216 | 3214 | constexpr @\exposid{copyable-box}@() noexcept(is_nothrow_default_constructible_v<T>)
|
3217 | 3215 | requires @\libconcept{default_initializable}@<T>
|
3218 |
| - : @\exposid{copyable-box}@{in_place} |
3219 |
| -{ } |
| 3216 | + : @\exposid{copyable-box}@{in_place} {} |
3220 | 3217 | \end{codeblock}
|
3221 | 3218 |
|
3222 | 3219 | \item If \tcode{\libconcept{copyable}<T>} is not
|
|
3267 | 3264 | \item
|
3268 | 3265 | The copy constructor is equivalent to:
|
3269 | 3266 | \begin{codeblock}
|
3270 |
| -constexpr @\exposid{non-propagating-cache}@(const @\exposid{non-propagating-cache}@&) noexcept { } |
| 3267 | +constexpr @\exposid{non-propagating-cache}@(const @\exposid{non-propagating-cache}@&) noexcept {} |
3271 | 3268 | \end{codeblock}
|
3272 | 3269 | \item
|
3273 | 3270 | The move constructor is equivalent to:
|
|
3394 | 3391 | constexpr auto data() const requires @\libconcept{contiguous_range}@<R>
|
3395 | 3392 | { return ranges::data(*@\exposid{r_}@); }
|
3396 | 3393 | };
|
| 3394 | + |
3397 | 3395 | template<class R>
|
3398 | 3396 | ref_view(R&) -> ref_view<R>;
|
3399 | 3397 | }
|
|
3457 | 3455 | constexpr auto end() const requires @\libconcept{range}@<const R>
|
3458 | 3456 | { return ranges::end(@\exposid{r_}@); }
|
3459 | 3457 |
|
3460 |
| - constexpr bool empty() |
3461 |
| - requires requires { ranges::empty(@\exposid{r_}@); } |
| 3458 | + constexpr bool empty() requires requires { ranges::empty(@\exposid{r_}@); } |
3462 | 3459 | { return ranges::empty(@\exposid{r_}@); }
|
3463 |
| - constexpr bool empty() const |
3464 |
| - requires requires { ranges::empty(@\exposid{r_}@); } |
| 3460 | + constexpr bool empty() const requires requires { ranges::empty(@\exposid{r_}@); } |
3465 | 3461 | { return ranges::empty(@\exposid{r_}@); }
|
3466 | 3462 |
|
3467 | 3463 | constexpr auto size() requires @\libconcept{sized_range}@<R>
|
|
4696 | 4692 |
|
4697 | 4693 | constexpr auto begin() requires (!@\exposconcept{simple-view}@<V>) {
|
4698 | 4694 | if constexpr (@\libconcept{sized_range}@<V>) {
|
4699 |
| - if constexpr (@\libconcept{random_access_range}@<V>) |
| 4695 | + if constexpr (@\libconcept{random_access_range}@<V>) { |
4700 | 4696 | return ranges::begin(@\exposid{base_}@);
|
4701 |
| - else { |
| 4697 | + } else { |
4702 | 4698 | auto sz = range_difference_t<V>(size());
|
4703 | 4699 | return counted_iterator(ranges::begin(@\exposid{base_}@), sz);
|
4704 | 4700 | }
|
4705 |
| - } else |
| 4701 | + } else { |
4706 | 4702 | return counted_iterator(ranges::begin(@\exposid{base_}@), @\exposid{count_}@);
|
| 4703 | + } |
4707 | 4704 | }
|
4708 | 4705 |
|
4709 | 4706 | constexpr auto begin() const requires @\libconcept{range}@<const V> {
|
4710 | 4707 | if constexpr (@\libconcept{sized_range}@<const V>) {
|
4711 |
| - if constexpr (@\libconcept{random_access_range}@<const V>) |
| 4708 | + if constexpr (@\libconcept{random_access_range}@<const V>) { |
4712 | 4709 | return ranges::begin(@\exposid{base_}@);
|
4713 |
| - else { |
| 4710 | + } else { |
4714 | 4711 | auto sz = range_difference_t<const V>(size());
|
4715 | 4712 | return counted_iterator(ranges::begin(@\exposid{base_}@), sz);
|
4716 | 4713 | }
|
4717 |
| - } else |
| 4714 | + } else { |
4718 | 4715 | return counted_iterator(ranges::begin(@\exposid{base_}@), @\exposid{count_}@);
|
| 4716 | + } |
4719 | 4717 | }
|
4720 | 4718 |
|
4721 | 4719 | constexpr auto end() requires (!@\exposconcept{simple-view}@<V>) {
|
|
4724 | 4722 | return ranges::begin(@\exposid{base_}@) + range_difference_t<V>(size());
|
4725 | 4723 | else
|
4726 | 4724 | return default_sentinel;
|
4727 |
| - } else |
| 4725 | + } else { |
4728 | 4726 | return @\exposid{sentinel}@<false>{ranges::end(@\exposid{base_}@)};
|
| 4727 | + } |
4729 | 4728 | }
|
4730 | 4729 |
|
4731 | 4730 | constexpr auto end() const requires @\libconcept{range}@<const V> {
|
|
4734 | 4733 | return ranges::begin(@\exposid{base_}@) + range_difference_t<const V>(size());
|
4735 | 4734 | else
|
4736 | 4735 | return default_sentinel;
|
4737 |
| - } else |
| 4736 | + } else { |
4738 | 4737 | return @\exposid{sentinel}@<true>{ranges::end(@\exposid{base_}@)};
|
| 4738 | + } |
4739 | 4739 | }
|
4740 | 4740 |
|
4741 | 4741 | constexpr auto size() requires @\libconcept{sized_range}@<V> {
|
|
5120 | 5120 | constexpr auto begin() const
|
5121 | 5121 | requires @\libconcept{random_access_range}@<const V> && @\libconcept{sized_range}@<const V>;
|
5122 | 5122 |
|
5123 |
| - constexpr auto end() |
5124 |
| - requires (!@\exposconcept{simple-view}@<V>) |
| 5123 | + constexpr auto end() requires (!@\exposconcept{simple-view}@<V>) |
5125 | 5124 | { return ranges::end(@\exposid{base_}@); }
|
5126 | 5125 |
|
5127 |
| - constexpr auto end() const |
5128 |
| - requires @\libconcept{range}@<const V> |
| 5126 | + constexpr auto end() const requires @\libconcept{range}@<const V> |
5129 | 5127 | { return ranges::end(@\exposid{base_}@); }
|
5130 | 5128 |
|
5131 |
| - constexpr auto size() |
5132 |
| - requires @\libconcept{sized_range}@<V> |
5133 |
| - { |
| 5129 | + constexpr auto size() requires @\libconcept{sized_range}@<V> { |
5134 | 5130 | const auto s = ranges::size(@\exposid{base_}@);
|
5135 | 5131 | const auto c = static_cast<decltype(s)>(@\exposid{count_}@);
|
5136 | 5132 | return s < c ? 0 : s - c;
|
5137 | 5133 | }
|
5138 | 5134 |
|
5139 |
| - constexpr auto size() const |
5140 |
| - requires @\libconcept{sized_range}@<const V> |
5141 |
| - { |
| 5135 | + constexpr auto size() const requires @\libconcept{sized_range}@<const V> { |
5142 | 5136 | const auto s = ranges::size(@\exposid{base_}@);
|
5143 | 5137 | const auto c = static_cast<decltype(s)>(@\exposid{count_}@);
|
5144 | 5138 | return s < c ? 0 : s - c;
|
5145 | 5139 | }
|
| 5140 | + |
5146 | 5141 | private:
|
5147 | 5142 | V @\exposid{base_}@ = V(); // \expos
|
5148 | 5143 | range_difference_t<V> @\exposid{count_}@ = 0; // \expos
|
|
5248 | 5243 |
|
5249 | 5244 | constexpr auto begin();
|
5250 | 5245 |
|
5251 |
| - constexpr auto end() |
5252 |
| - { return ranges::end(@\exposid{base_}@); } |
| 5246 | + constexpr auto end() { return ranges::end(@\exposid{base_}@); } |
5253 | 5247 |
|
5254 | 5248 | private:
|
5255 | 5249 | V @\exposid{base_}@ = V(); // \expos
|
|
5378 | 5372 | }
|
5379 | 5373 |
|
5380 | 5374 | constexpr auto begin() const
|
5381 |
| - requires @\libconcept{input_range}@<const V> && |
5382 |
| - is_reference_v<range_reference_t<const V>> { |
5383 |
| - return @\exposid{iterator}@<true>{*this, ranges::begin(@\exposid{base_}@)}; |
5384 |
| - } |
| 5375 | + requires @\libconcept{input_range}@<const V> && |
| 5376 | + is_reference_v<range_reference_t<const V>> |
| 5377 | + { return @\exposid{iterator}@<true>{*this, ranges::begin(@\exposid{base_}@)}; } |
5385 | 5378 |
|
5386 | 5379 | constexpr auto end() {
|
5387 | 5380 | if constexpr (@\libconcept{forward_range}@<V> &&
|
|
5393 | 5386 | }
|
5394 | 5387 |
|
5395 | 5388 | constexpr auto end() const
|
5396 |
| - requires @\libconcept{input_range}@<const V> && |
5397 |
| - is_reference_v<range_reference_t<const V>> { |
| 5389 | + requires @\libconcept{input_range}@<const V> && |
| 5390 | + is_reference_v<range_reference_t<const V>> { |
5398 | 5391 | if constexpr (@\libconcept{forward_range}@<const V> &&
|
5399 | 5392 | @\libconcept{forward_range}@<range_reference_t<const V>> &&
|
5400 | 5393 | @\libconcept{common_range}@<const V> &&
|
|
5444 | 5437 | @\exposidnc{Parent}@* @\exposid{parent_}@ = nullptr; // \expos
|
5445 | 5438 |
|
5446 | 5439 | constexpr void @\exposidnc{satisfy}@(); // \expos
|
| 5440 | + |
5447 | 5441 | public:
|
5448 | 5442 | using iterator_concept = @\seebelow@;
|
5449 | 5443 | using iterator_category = @\seebelow@; // not always present
|
|
5750 | 5744 | using @\exposid{Parent}@ = @\exposid{maybe-const}@<Const, join_view>; // \expos
|
5751 | 5745 | using @\exposid{Base}@ = @\exposid{maybe-const}@<Const, V>; // \expos
|
5752 | 5746 | sentinel_t<@\exposid{Base}@> @\exposid{end_}@ = sentinel_t<@\exposid{Base}@>(); // \expos
|
| 5747 | + |
5753 | 5748 | public:
|
5754 | 5749 | @\exposid{sentinel}@() = default;
|
5755 | 5750 |
|
|
5879 | 5874 | constexpr V base() && { return std::move(@\exposid{base_}@); }
|
5880 | 5875 |
|
5881 | 5876 | constexpr auto begin() {
|
5882 |
| - if constexpr (@\libconcept{forward_range}@<V>) |
| 5877 | + if constexpr (@\libconcept{forward_range}@<V>) { |
5883 | 5878 | return @\exposid{outer-iterator}@<@\exposconcept{simple-view}@<V> && @\exposconcept{simple-view}@<Pattern>>
|
5884 | 5879 | {*this, ranges::begin(@\exposid{base_}@)};
|
5885 |
| - else { |
| 5880 | + } else { |
5886 | 5881 | @\exposid{current_}@ = ranges::begin(@\exposid{base_}@);
|
5887 | 5882 | return @\exposid{outer-iterator}@<false>{*this};
|
5888 | 5883 | }
|
|
6900 | 6895 | constexpr auto size() requires @\libconcept{sized_range}@<V> {
|
6901 | 6896 | return ranges::size(@\exposid{base_}@);
|
6902 | 6897 | }
|
| 6898 | + |
6903 | 6899 | constexpr auto size() const requires @\libconcept{sized_range}@<const V> {
|
6904 | 6900 | return ranges::size(@\exposid{base_}@);
|
6905 | 6901 | }
|
|
8419 | 8415 |
|
8420 | 8416 | constexpr explicit zip_transform_view(F fun, Views... views);
|
8421 | 8417 |
|
8422 |
| - constexpr auto begin() { |
8423 |
| - return @\exposid{iterator}@<false>(*this, @\exposid{zip_}@.begin()); |
8424 |
| - } |
| 8418 | + constexpr auto begin() { return @\exposid{iterator}@<false>(*this, @\exposid{zip_}@.begin()); } |
8425 | 8419 |
|
8426 | 8420 | constexpr auto begin() const
|
8427 | 8421 | requires @\libconcept{range}@<const @\exposid{InnerView}@> &&
|
|
0 commit comments