xo-tokenizer: feat: + span::operator+=

This commit is contained in:
Roland Conybeare 2024-08-06 09:33:03 -04:00
commit ec7d50f052

View file

@ -93,6 +93,16 @@ namespace xo {
/** @brief report the number of elements (of type CharT) in this span. **/
size_type size() const { return hi_ - lo_; }
span & operator+=(const span & x) {
if (hi_ == x.lo_) {
hi_ = x.hi_;
} else {
assert(false);
}
return *this;
}
/** print representation for this span on stream @p os **/
void print(std::ostream & os) const {
os << "<span"