\brief Create an iterator representing the first invalid logical position of the run-end encoded array \warning Avoid calling end() in a loop, as it will recompute the physical length of the array on each call (O(log N) cost per call). You can write your loops like this instead: \code for (auto it = array.begin(), end = array.end(); it != end; ++it) { // ... } \endcode Or this version that doe
| 409 | /// } |
| 410 | /// \endcode |
| 411 | Iterator end() const { |
| 412 | return iterator(length(), |
| 413 | (length() == 0) ? PhysicalIndex(0) : PhysicalIndex(length() - 1) + 1); |
| 414 | } |
| 415 | |
| 416 | // Pre-condition: physical_pos < RunEndsArray(array_span_).length); |
| 417 | inline int64_t run_end(int64_t physical_pos) const { |