[ostringstream.members] # 31 Input/output library [[input.output]](./#input.output) ## 31.8 String-based streams [[string.streams]](string.streams#ostringstream.members) ### 31.8.4 Class template basic_ostringstream [[ostringstream]](ostringstream#members) #### 31.8.4.4 Member functions [ostringstream.members] [🔗](#lib:rdbuf,basic_ostringstream) `basic_stringbuf* rdbuf() const; ` [1](#1) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L9519) *Returns*: const_cast*>(addressof(*sb*))[.](#1.sentence-1) [🔗](#lib:str,basic_ostringstream) `basic_string str() const &; ` [2](#2) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L9530) *Effects*: Equivalent to: return rdbuf()->str(); [🔗](#lib:str,basic_ostringstream_) `template basic_string str(const SAlloc& sa) const; ` [3](#3) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L9542) *Effects*: Equivalent to: return rdbuf()->str(sa); [🔗](#lib:str,basic_ostringstream__) `basic_string str() &&; ` [4](#4) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L9553) *Effects*: Equivalent to: return std​::​move(*rdbuf()).str(); [🔗](#lib:view,basic_ostringstream) `basic_string_view view() const noexcept; ` [5](#5) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L9564) *Effects*: Equivalent to: return rdbuf()->view(); [🔗](#lib:str,basic_ostringstream___) `void str(const basic_string& s); ` [6](#6) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L9575) *Effects*: Equivalent to: rdbuf()->str(s); [🔗](#lib:str,basic_ostringstream____) `template void str(const basic_string& s); ` [7](#7) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L9587) *Effects*: Equivalent to: rdbuf()->str(s); [🔗](#lib:str,basic_ostringstream_____) `void str(basic_string&& s); ` [8](#8) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L9598) *Effects*: Equivalent to: rdbuf()->str(std​::​move(s)); [🔗](#lib:str,basic_ostringstream______) `template void str(const T& t); ` [9](#9) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L9610) *Constraints*: is_convertible_v> is true[.](#9.sentence-1) [10](#10) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L9615) *Effects*: Equivalent to: rdbuf()->str(t);