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

Copies the contents of a `src` Cord into a `&ast;dst` string&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
CopyCordToString(
    xref:absl/Cord.adoc[Cord] const& src,
    std::string* dst);
----

== Description

This function optimizes the case of reusing the destination string since it can reuse previously allocated capacity&period; However, this function does not guarantee that pointers previously returned by `dst&hyphen;&gt;data()` remain valid even if `&ast;dst` had enough capacity to hold `src`&period; If `&ast;dst` is a new object, prefer to simply use the conversion operator to `std&colon;&colon;string`&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *src*
| The Cord whose contents are copied&period;
| *dst*
| The string that receives the copied contents&period;
|===


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