e_ -= n;
}
+ Range subpiece(size_type first, size_type length = npos) const {
+ if (UNLIKELY(first > size())) {
+ throw std::out_of_range("index out of range");
+ }
+
+ return Range(b_ + first, std::min(length, size() - first));
+ }
+
+ // unchecked versions
+ void uncheckedAdvance(size_type n) {
+ DCHECK_LE(n, size());
+ b_ += n;
+ }
+
+ void uncheckedSubtract(size_type n) {
+ DCHECK_LE(n, size());
+ e_ -= n;
+ }
+
+ Range uncheckedSubpiece(size_type first, size_type length = npos) const {
+ DCHECK_LE(first, size());
+ return Range(b_ + first, std::min(length, size() - first));
+ }
+
void pop_front() {
assert(b_ < e_);
++b_;
--e_;
}
- Range subpiece(size_type first, size_type length = npos) const {
- if (UNLIKELY(first > size())) {
- throw std::out_of_range("index out of range");
- }
-
- return Range(b_ + first, std::min(length, size() - first));
- }
-
// string work-alike functions
size_type find(const_range_type str) const {
return qfind(castToConst(), str);