Returns a Cord::CharRange for iterating over the characters of a Cord with a range‐based for‐loop.

Synopsis

Declared in <absl/strings/cord.h>

Cord::CharRange
Chars() const;

Description

For most character‐based iteration tasks on a Cord, use Cord::Chars() to retrieve this iterator.

Example:

void ProcessCord(const Cord& cord) { for (char c : cord.Chars()) { ... } }

Note that the ordinary caveats of temporary lifetime extension apply:

void Process() { for (char c : CordFactory().Chars()) { // The temporary Cord returned by CordFactory has been destroyed! } }

Return Value

A range over the characters of the Cord.

Created with MrDocs