From Jason Turner

[range.chunk.view.fwd]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp3gow8fro/{from.md → to.md} +15 -0
tmp/tmp3gow8fro/{from.md → to.md} RENAMED
@@ -47,10 +47,13 @@ namespace std::ranges {
47
  }
48
  }
49
 
50
  constexpr auto size() requires sized_range<V>;
51
  constexpr auto size() const requires sized_range<const V>;
 
 
 
52
  };
53
  }
54
  ```
55
 
56
  ``` cpp
@@ -71,5 +74,17 @@ constexpr auto size() const requires sized_range<const V>;
71
 
72
  ``` cpp
73
  return to-unsigned-like(div-ceil(ranges::distance(base_), n_));
74
  ```
75
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
  }
48
  }
49
 
50
  constexpr auto size() requires sized_range<V>;
51
  constexpr auto size() const requires sized_range<const V>;
52
+
53
+ constexpr auto reserve_hint() requires approximately_sized_range<V>;
54
+ constexpr auto reserve_hint() const requires approximately_sized_range<const V>;
55
  };
56
  }
57
  ```
58
 
59
  ``` cpp
 
74
 
75
  ``` cpp
76
  return to-unsigned-like(div-ceil(ranges::distance(base_), n_));
77
  ```
78
 
79
+ ``` cpp
80
+ constexpr auto reserve_hint() requires approximately_sized_range<V>;
81
+ constexpr auto reserve_hint() const requires approximately_sized_range<const V>;
82
+ ```
83
+
84
+ *Effects:* Equivalent to:
85
+
86
+ ``` cpp
87
+ auto s = static_cast<range_difference_t<decltype((base_))>>(ranges::reserve_hint(base_));
88
+ return to-unsigned-like(div-ceil(s, n_));
89
+ ```
90
+