From e04210bed5ac0849cd1f6eb7cf687d6c6647e4bb Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Tue, 10 Mar 2020 13:59:12 +0000 Subject: [PATCH] [range.split.outer], [range.split.inner] Fix misuses of current_ This restores references to the 'current' placeholder. Fixes #3848 --- source/ranges.tex | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/source/ranges.tex b/source/ranges.tex index dcc6e2c38e..27040e7a39 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -5590,17 +5590,17 @@ Equivalent to: \begin{codeblock} const auto end = ranges::end(@\exposid{parent_}@->@\exposid{base_}@); -if (@\exposid{current_}@ == end) return *this; +if (@\placeholder{current}@ == end) return *this; const auto [pbegin, pend] = subrange{@\exposid{parent_}@->@\exposid{pattern_}@}; -if (pbegin == pend) ++@\exposid{current_}@; +if (pbegin == pend) ++@\placeholder{current}@; else { do { - auto [b, p] = ranges::mismatch(std::move(@\exposid{current_}@), end, pbegin, pend); - @\exposid{current_}@ = std::move(b); + auto [b, p] = ranges::mismatch(std::move(@\placeholder{current}@), end, pbegin, pend); + @\placeholder{current}@ = std::move(b); if (p == pend) { break; // The pattern matched; skip it } - } while (++@\exposid{current_}@ != end); + } while (++@\placeholder{current}@ != end); } return *this; \end{codeblock} @@ -5626,7 +5626,7 @@ \begin{itemdescr} \pnum \effects -Equivalent to: \tcode{return x.\exposid{current_} == ranges::end(x.\exposid{parent_}->\exposid{base_});} +Equivalent to: \tcode{return x.\placeholdernc{current} == ranges::end(x.\exposid{parent_}->\exposid{base_});} \end{itemdescr} \rSec3[range.split.outer.value]{Class \tcode{split_view::\exposid{outer-iterator}::value_type}} @@ -5715,7 +5715,7 @@ @\exposid{inner-iterator}@() = default; constexpr explicit @\exposid{inner-iterator}@(@\exposid{outer-iterator}@ i); - constexpr decltype(auto) operator*() const { return *@\exposid{i_}@.@\exposid{current_}@; } + constexpr decltype(auto) operator*() const { return *@\exposid{i_}@.@\placeholder{current}@; } constexpr @\exposid{inner-iterator}@& operator++(); constexpr decltype(auto) operator++(int) {