xo-tokenizer: feat: + span::operator+=
This commit is contained in:
parent
5ed786adc0
commit
ec7d50f052
1 changed files with 10 additions and 0 deletions
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue