[stringstream.swap]

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

## 31.8 String-based streams [[string.streams]](string.streams#stringstream.swap)

### 31.8.5 Class template basic_stringstream [[stringstream]](stringstream#swap)

#### 31.8.5.3 Swap [stringstream.swap]

[ð](#lib:swap,basic_stringstream)

`void swap(basic_stringstream& rhs);
`

[1](#1)

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

*Effects*: Equivalent to:basic_iostream<charT,traits>::swap(rhs);*sb*.swap(rhs.*sb*);

[ð](#lib:swap,basic_stringstream_)

`template<class charT, class traits, class Allocator>
  void swap(basic_stringstream<charT, traits, Allocator>& x,
            basic_stringstream<charT, traits, Allocator>& y);
`

[2](#2)

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

*Effects*: Equivalent to x.swap(y)[.](#2.sentence-1)
