29 Input/output library [input.output]

29.9 File-based streams [file.streams]

29.9.5 Class template basic_­fstream [fstream] Assignment and swap [fstream.assign]

basic_fstream& operator=(basic_fstream&& rhs);
Effects: Move assigns the base and members of *this from the base and corresponding members of rhs.
Returns: *this.
void swap(basic_fstream& rhs);
Effects: Exchanges the state of *this and rhs by calling basic_­iostream<charT,traits>​::​swap(rhs) and sb.swap(rhs.sb).
template<class charT, class traits> void swap(basic_fstream<charT, traits>& x, basic_fstream<charT, traits>& y);
Effects: As if by x.swap(y).