absl::Cord::CharIterator

Iterates over the constituent characters of a Cord.

Synopsis

Declared in <absl/strings/cord.h>

class CharIterator;

Description

A Cord::CharIterator allows iteration over the constituent characters of a Cord.

Generally, you do not instantiate a Cord::CharIterator directly; instead, you create one implicitly through use of the Cord::Chars() member function.

A Cord::CharIterator has the following properties:

* The iterator is invalidated after any non-const operation on the Cord object over which it iterates. * Two CharIterator objects can be compared equal if and only if they remain valid and iterate over the same Cord. * The iterator keeps state that can grow for Cords that contain many nodes and are imbalanced due to sharing. Prefer to pass this type by const reference instead of by value. * This type cannot act as a forward iterator because a Cord can reuse sections of memory. This fact violates the requirement for forward iterators to compare equal if dereferencing them returns the same object.

Type Aliases

NameDescription
difference_type The type used to represent distances between iterators.
iterator_category The iterator category tag (input iterator).
pointer The pointer type for the iterated values.
reference The reference type for the iterated values.
value_type The type of the values iterated over.

Member Functions

NameDescription
CharIterator [constructor]Constructs an iterator in the end / singular state.
operator* Dereferences the iterator.
operator++ Advances the iterator to the next character.
operator== Compares two iterators for equality.
operator!= Compares two iterators for inequality.

Friends

NameDescription
absl::CordA sequence of characters stored as a tree of buffers.