Files
2025-10-25 03:02:53 +03:00

54 lines
1.5 KiB
Markdown
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[filebuf.assign]
# 31 Input/output library [[input.output]](./#input.output)
## 31.10 File-based streams [[file.streams]](file.streams#filebuf.assign)
### 31.10.3 Class template basic_filebuf [[filebuf]](filebuf#assign)
#### 31.10.3.3 Assignment and swap [filebuf.assign]
[🔗](#lib:operator=,basic_filebuf)
`basic_filebuf& operator=(basic_filebuf&& rhs);
`
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L11166)
*Effects*: Calls close() then move assigns from rhs[.](#1.sentence-1)
After the
move assignment *this has the observable state it would have had if it
had been move constructed from rhs (see [[filebuf.cons]](filebuf.cons "31.10.3.2Constructors"))[.](#1.sentence-2)
[2](#2)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L11172)
*Returns*: *this[.](#2.sentence-1)
[🔗](#lib:swap,basic_filebuf)
`void swap(basic_filebuf& rhs);
`
[3](#3)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L11183)
*Effects*: Exchanges the state of *this and rhs[.](#3.sentence-1)
[🔗](#lib:swap,basic_filebuf_)
`template<class charT, class traits>
void swap(basic_filebuf<charT, traits>& x, basic_filebuf<charT, traits>& y);
`
[4](#4)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L11196)
*Effects*: Equivalent to x.swap(y)[.](#4.sentence-1)