[#absl-Cord-CharIterator] = xref:absl.adoc[absl]::xref:absl/Cord.adoc[Cord]::CharIterator :relfileprefix: ../../ :mrdocs: Iterates over the constituent characters of a `Cord`. == Synopsis Declared in `<absl/strings/cord.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- 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 [cols="1,4"] |=== | Name| Description | xref:absl/Cord/CharIterator/difference_type.adoc[`difference_type`] | The type used to represent distances between iterators. | xref:absl/Cord/CharIterator/iterator_category.adoc[`iterator_category`] | The iterator category tag (input iterator). | xref:absl/Cord/CharIterator/pointer.adoc[`pointer`] | The pointer type for the iterated values. | xref:absl/Cord/CharIterator/reference.adoc[`reference`] | The reference type for the iterated values. | xref:absl/Cord/CharIterator/value_type.adoc[`value_type`] | The type of the values iterated over. |=== == Member Functions [cols="1,4"] |=== | Name| Description | xref:absl/Cord/CharIterator/2constructor.adoc[`CharIterator`] [.small]#[constructor]# | Constructs an iterator in the end / singular state. | xref:absl/Cord/CharIterator/operator_star.adoc[`operator*`] | Dereferences the iterator. | xref:absl/Cord/CharIterator/operator_inc-09.adoc[`operator++`] | Advances the iterator to the next character. | xref:absl/Cord/CharIterator/operator_eq.adoc[`operator==`] | Compares two iterators for equality. | xref:absl/Cord/CharIterator/operator_not_eq.adoc[`operator!=`] | Compares two iterators for inequality. |=== == Friends [cols="1,4"] |=== | Name| Description | `xref:absl/Cord.adoc[absl::Cord]` | A sequence of characters stored as a tree of buffers. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#