[#absl-Cord-Chunks]
= xref:absl.adoc[absl]::xref:absl/Cord.adoc[Cord]::Chunks
:relfileprefix: ../../
:mrdocs:

Returns a `Cord&colon;&colon;ChunkRange` for iterating over the chunks of a `Cord` with a range&hyphen;based for&hyphen;loop&period;

== Synopsis

Declared in `&lt;absl&sol;strings&sol;cord&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:absl/Cord/ChunkRange.adoc[Cord::ChunkRange]
Chunks() const;
----

== Description

For most iteration tasks on a Cord, use `Cord&colon;&colon;Chunks()` to retrieve this iterator&period;

Example&colon;

void ProcessChunks(const Cord&amp; cord) &lcub; for (absl&colon;&colon;string&lowbar;view chunk &colon; cord&period;Chunks()) &lcub; &period;&period;&period; &rcub; &rcub;

Note that the ordinary caveats of temporary lifetime extension apply&colon;

void Process() &lcub; for (absl&colon;&colon;string&lowbar;view chunk &colon; CordFactory()&period;Chunks()) &lcub; &sol;&sol; The temporary Cord returned by CordFactory has been destroyed! &rcub; &rcub;

== Return Value

A range over the chunks of the Cord&period;


[.small]#Created with https://www.mrdocs.com[MrDocs]#
