void advance(difference_type n) { pos += n; if (n > 0) { while (part < vec->nparts() && pos >= vec->part[part + 1]) ++part; } else if (n < 0) { while (part > 0 && pos < vec->part[part]) --part; } }
void increment() { ++pos; while (part < vec->nparts() && pos >= vec->part[part + 1]) ++part; }