For a type that represents a sequence of byes bound from two sides, operator+= does not generalize from raw pointers unambiguously and has counterintuitive semantics:
operator+= associated with "increasing" actually shrinks the buffer.
std::string which can be made a buffer, uses operator+= for something completely different.
Please use a named member function for this purpose, like .consume_prefix().
For a type that represents a sequence of byes bound from two sides,
operator+=does not generalize from raw pointers unambiguously and has counterintuitive semantics:operator+=associated with "increasing" actually shrinks the buffer.std::stringwhich can be made a buffer, usesoperator+=for something completely different.Please use a named member function for this purpose, like
.consume_prefix().