diff --git a/include/beman/utf_view/to_utf_view.hpp b/include/beman/utf_view/to_utf_view.hpp index 954bfd7..d367e7f 100644 --- a/include/beman/utf_view/to_utf_view.hpp +++ b/include/beman/utf_view/to_utf_view.hpp @@ -186,14 +186,14 @@ class exposition_only_to_utf_view_impl { /* !PAPER */ #if defined(__cpp_lib_ranges_reserve_hint) - /* PAPER */ + /* PAPER: constexpr auto reserve_hint() requires approximately_sized_range; */ constexpr auto reserve_hint() requires std::ranges::approximately_sized_range { return std::ranges::reserve_hint(base_); } + /* PAPER: constexpr auto reserve_hint() const requires approximately_sized_range; */ constexpr auto reserve_hint() const requires std::ranges::approximately_sized_range; { return std::ranges::reserve_hint(base_); } - /* !PAPER */ #endif /* PAPER */ }; diff --git a/paper/P2728.md b/paper/P2728.md index 2ac491e..8303515 100644 --- a/paper/P2728.md +++ b/paper/P2728.md @@ -625,12 +625,8 @@ public: constexpr bool empty() const { return empty(@*base_*@); } - constexpr auto reserve_hint() requires approximately_sized_range - { - return reserve_hint(@*base_*@); - } + constexpr auto reserve_hint() requires approximately_sized_range; constexpr auto reserve_hint() const requires approximately_sized_range; - { return reserve_hint(@*base_*@); } }; ``` @@ -648,6 +644,18 @@ _Returns:_ `{*this, std::ranges::begin(base_)}` _Remarks:_ In order to provide the amortized constant time complexity required by the `range` concept when `@*to-utf-view-impl*@` transcodes from UTF-8 or UTF-16, this function caches the result within the `@*to-utf-view-impl*@` for use on subsequent calls. +```cpp +constexpr auto reserve_hint() requires approximately_sized_range; +``` + +_Returns:_ The result is implementation-defined. + +```cpp +constexpr auto reserve_hint() const requires approximately_sized_range; +``` + +_Returns:_ The result is implementation-defined. + ::: note The implementation of the `empty()` member function provided by the