Skip to content

Rename operator+= for const_buffer and mutable_buffer #430

Description

@akrzemi1

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:

  1. operator+= associated with "increasing" actually shrinks the buffer.
  2. 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().

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    • Status
      Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions