folly::io::Cursor::operator-

Subtraction operators

Synopses

Declared in <folly/io/Cursor.h>

Get a new cursor, retreated by offset from this cursor.

Cursor
operator-(size_t offset) const;
» more...

Return the distance between two cursors.

size_t
operator-(CursorBase<Cursor, IOBuf const> const& other) const;
» more...

Return the distance from the given IOBuf to the this cursor.

size_t
operator-(IOBuf const* buf) const;
» more...

Return Value

  • A new cursor retreated by offset.
  • The number of bytes between the two cursors.
  • The number of bytes between the IOBuf and this cursor.

Parameters

NameDescription
offsetThe number of bytes to retreat.
otherThe cursor to measure the distance from.
bufThe IOBuf to measure the distance from.