Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions include/beman/utf_view/to_utf_view.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<V>; */
constexpr auto reserve_hint() requires std::ranges::approximately_sized_range<V> {
return std::ranges::reserve_hint(base_);
}
/* PAPER: constexpr auto reserve_hint() const requires approximately_sized_range<const V>; */
constexpr auto reserve_hint() const requires std::ranges::approximately_sized_range<const V>; {
return std::ranges::reserve_hint(base_);
}
/* !PAPER */
#endif
/* PAPER */
};
Expand Down
18 changes: 13 additions & 5 deletions paper/P2728.md
Original file line number Diff line number Diff line change
Expand Up @@ -625,12 +625,8 @@ public:

constexpr bool empty() const { return empty(@*base_*@); }

constexpr auto reserve_hint() requires approximately_sized_range<V>
{
return reserve_hint(@*base_*@);
}
constexpr auto reserve_hint() requires approximately_sized_range<V>;
constexpr auto reserve_hint() const requires approximately_sized_range<const V>;
{ return reserve_hint(@*base_*@); }
};
```

Expand All @@ -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<V>;
```

_Returns:_ The result is implementation-defined.

```cpp
constexpr auto reserve_hint() const requires approximately_sized_range<const V>;
```

_Returns:_ The result is implementation-defined.

::: note

The implementation of the `empty()` member function provided by the
Expand Down