[sstream.syn]

# 31 Input/output library [[input.output]](./#input.output)

## 31.8 String-based streams [[string.streams]](string.streams#sstream.syn)

### 31.8.1 Header <sstream> synopsis [sstream.syn]

[ð](#header:%3csstream%3e)

namespace std {// [[stringbuf]](stringbuf "31.8.2 Class template basic_­stringbuf"), class template basic_stringbuftemplate<class charT, class traits = char_traits<charT>, class Allocator = allocator<charT>>class basic_stringbuf; template<class charT, class traits, class Allocator>void swap(basic_stringbuf<charT, traits, Allocator>& x,
 basic_stringbuf<charT, traits, Allocator>& y) noexcept(noexcept(x.swap(y))); using stringbuf = basic_stringbuf<char>; using wstringbuf = basic_stringbuf<wchar_t>; // [[istringstream]](istringstream "31.8.3 Class template basic_­istringstream"), class template basic_istringstreamtemplate<class charT, class traits = char_traits<charT>, class Allocator = allocator<charT>>class basic_istringstream; template<class charT, class traits, class Allocator>void swap(basic_istringstream<charT, traits, Allocator>& x,
 basic_istringstream<charT, traits, Allocator>& y); using istringstream = basic_istringstream<char>; using wistringstream = basic_istringstream<wchar_t>; // [[ostringstream]](ostringstream "31.8.4 Class template basic_­ostringstream"), class template basic_ostringstreamtemplate<class charT, class traits = char_traits<charT>, class Allocator = allocator<charT>>class basic_ostringstream; template<class charT, class traits, class Allocator>void swap(basic_ostringstream<charT, traits, Allocator>& x,
 basic_ostringstream<charT, traits, Allocator>& y); using ostringstream = basic_ostringstream<char>; using wostringstream = basic_ostringstream<wchar_t>; // [[stringstream]](stringstream "31.8.5 Class template basic_­stringstream"), class template basic_stringstreamtemplate<class charT, class traits = char_traits<charT>, class Allocator = allocator<charT>>class basic_stringstream; template<class charT, class traits, class Allocator>void swap(basic_stringstream<charT, traits, Allocator>& x,
 basic_stringstream<charT, traits, Allocator>& y); using stringstream = basic_stringstream<char>; using wstringstream = basic_stringstream<wchar_t>;}

[1](#1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L8012)

The header [<sstream>](#header:%3csstream%3e "31.8.1 Header <sstream> synopsis [sstream.syn]") defines four class templates
and eight types that associate stream buffers with objects of classbasic_string,as described in [[string.classes]](string.classes "27.4 String classes")[.](#1.sentence-1)
