diff --git a/include/beman/utf_view/to_utf_view.hpp b/include/beman/utf_view/to_utf_view.hpp index 70bcf46..afb1566 100644 --- a/include/beman/utf_view/to_utf_view.hpp +++ b/include/beman/utf_view/to_utf_view.hpp @@ -178,17 +178,6 @@ class exposition_only_to_utf_view_impl { return std::move(base_); } - /* PAPER: constexpr expected @*success*@() const noexcept requires(OrError); // @*exposition only*@ */ - /* !PAPER */ - - constexpr bool exposition_only_success() const noexcept // @*exposition only*@ - requires(OrError) - { - return !!success_; - } - - /* PAPER */ - /* PAPER: constexpr value_type operator*() const; */ /* !PAPER */ constexpr value_type operator*() const { @@ -201,20 +190,6 @@ class exposition_only_to_utf_view_impl { } /* PAPER */ - constexpr void exposition_only_advance_one() // @*exposition only*@ - { - ++buf_index_; - if (buf_index_ == buf_.size()) { - if constexpr (std::forward_iterator) { - buf_index_ = 0; - std::advance(base(), to_increment_); - } - if (base() != end()) { - read(); - } - } - } - constexpr exposition_only_utf_iterator& operator++() requires(OrError) { if (!exposition_only_success()) { @@ -326,6 +301,31 @@ class exposition_only_to_utf_view_impl { return std::ranges::end(backptr_->base_); } + /* PAPER: constexpr expected @*success*@() const noexcept requires(OrError); // @*exposition only*@ */ + /* !PAPER */ + + constexpr bool exposition_only_success() const noexcept // @*exposition only*@ + requires(OrError) + { + return !!success_; + } + + /* PAPER */ + + constexpr void exposition_only_advance_one() // @*exposition only*@ + { + ++buf_index_; + if (buf_index_ == buf_.size()) { + if constexpr (std::forward_iterator) { + buf_index_ = 0; + std::advance(base(), to_increment_); + } + if (base() != end()) { + read(); + } + } + } + /* !PAPER */ static constexpr decode_code_point_result decode_code_point_utf8_impl( diff --git a/paper/P2728.md b/paper/P2728.md index 5f284ba..0a1c796 100644 --- a/paper/P2728.md +++ b/paper/P2728.md @@ -560,22 +560,6 @@ namespace std::ranges { constexpr @*iter*@ base() && { return move(base_); } - constexpr expected @*success*@() const noexcept requires(OrError); // @*exposition only*@ - - constexpr void @*advance-one*@() // @*exposition only*@ - { - ++buf_index_; - if (buf_index_ == buf_.size()) { - if constexpr (forward_iterator<@*iter*@>) { - buf_index_ = 0; - advance(base(), to_increment_); - } - if (base() != end()) { - read(); - } - } - } - constexpr @*utf-iterator*@& operator++() requires (OrError) { if (!@*success*@()) { @@ -650,6 +634,22 @@ namespace std::ranges { return ranges::end(backptr_->base_); } + constexpr expected @*success*@() const noexcept requires(OrError); // @*exposition only*@ + + constexpr void @*advance-one*@() // @*exposition only*@ + { + ++buf_index_; + if (buf_index_ == buf_.size()) { + if constexpr (forward_iterator<@*iter*@>) { + buf_index_ = 0; + advance(base(), to_increment_); + } + if (base() != end()) { + read(); + } + } + } + constexpr void read(); // @*exposition only*@ constexpr void read_reverse(); // @*exposition only*@