Advance and count the number of occurrences of a value. The count is limited to at most the next `batch_size` items. @return The matching value count and number of elements that were processed.
| 317 | /// The count is limited to at most the next `batch_size` items. |
| 318 | /// @return The matching value count and number of elements that were processed. |
| 319 | RleCountUpToResult CountUpTo(const RleCountUpToParams<value_type>& p) { |
| 320 | const auto steps = Advance(p.batch_size); |
| 321 | return {.matching_count = steps * (p.value == value_), .processed_count = steps}; |
| 322 | } |
| 323 | |
| 324 | /// Get the next value and return false if there are no more. |
| 325 | [[nodiscard]] constexpr bool Get(value_type* out_value, rle_size_t value_bit_width) { |