Append the range with percent-decoded applied to an existing string.
template< class MutableString> MutableString& append_to( MutableString& s) const;
This function applies percent-decoding to each character in the referenced
buffer and appends it to s
which must satisfy the requirements of MutableString.
In particular this expression must be valid:
s.append( this->begin(), this->end() );
Depending on the implementation of MutableString
this allows the caller to recycle capacity that resides in an already-existing
container when applying percent-decoding, as shown in this example:
void f( decode_view s ) { thread_local static std::string tmp; // Existing capacity of `tmp` will be reused first. // If this function is called repeatedly, then the // following three lines will almost never perform a // memory allocation: tmp = "The decoded value is '"; s.append_to( tmp ); tmp += "'\n"; std::cout << tmp; }
is_mutable_string_v< MutableString >
Linear in this->size()
,
plus s.append( this->begin(), this->end() )
.
A string representing the entire contents of the decoded range.