[#bsl-basic_stringbuf-str-03]
= xref:bsl.adoc[bsl]::xref:bsl/basic_stringbuf.adoc[basic&lowbar;stringbuf]::str
:relfileprefix: ../../
:mrdocs:

Return the buffered sequence of characters using the given allocator&period;

== Synopsis

Declared in `&lt;bslstl&lowbar;stringbuf&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class SALLOC&gt;
xref:bsl/basic_string-0faf.adoc[basic&lowbar;string&lt;CHAR&lowbar;TYPE, CHAR&lowbar;TRAITS, SALLOC&gt;]
str(SALLOC const& allocator) const
requires bsl&colon;&colon;IsStdAllocator&lt;SALLOC&gt;&colon;&colon;value;
----

== Description

Return the currently buffered sequence of characters in a `basic&lowbar;string` that uses the specified `allocator`&period; If this object was created only in input mode, the resultant `basic&lowbar;string` contains the character sequence in the range `&lsqb;eback(), egptr())&rsqb;`&period; If `modeBitMask &amp; ios&lowbar;base&colon;&colon;out` specified at construction is nonzero then the resultant `basic&lowbar;string` contains the character sequence in the range `&lsqb;pbase(), high&lowbar;mark)&rsqb;`, where `high&lowbar;mark` represents the position one past the highest initialized character in the buffer&period; Otherwise this object has been created in neither input nor output mode and a zero length `basic&lowbar;string` is returned&period;

== Return Value

buffered character sequence using the specified allocator

== Parameters

[cols="1,4"]
|===
| Name| Description
| *allocator*
| allocator for the returned string
|===


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