absl::AppendCordToString

Appends the contents of a src Cord to a *dst string.

Synopsis

Declared in <absl/strings/cord.h>

void
AppendCordToString(
    Cord const& src,
    std::string* dst);

Description

This function optimizes the case of appending to a non-empty destination string. If *dst already has capacity to store the contents of the cord, this function does not invalidate pointers previously returned by dst->data(). If *dst is a new object, prefer to simply use the conversion operator to std::string.

Parameters

NameDescription
srcThe Cord whose contents are appended.
dstThe string that receives the appended contents.