27 Input/output library [input.output]

27.9 File-based streams [file.streams]

27.9.1 File streams [fstreams]

27.9.1.15 basic_fstream constructors [fstream.cons]

basic_fstream();

Effects: Constructs an object of class basic_fstream<charT,traits>, initializing the base class with basic_iostream(&sb) and initializing sb with basic_filebuf<charT,traits>().

explicit basic_fstream(const char* s, ios_base::openmode mode = ios_base::in|ios_base::out);

Effects: Constructs an object of class basic_fstream<charT, traits>, initializing the base class with basic_iostream(&sb) and initializing sb with basic_filebuf<charT, traits>(). Then calls rdbuf()->open(s, mode). If that function returns a null pointer, calls setstate(failbit).

explicit basic_fstream(const string& s, ios_base::openmode mode = ios_base::in|ios_base::out);

Effects: the same as basic_fstream(s.c_str(), mode);

basic_fstream(basic_fstream&& rhs);

Effects: Move constructs from the rvalue rhs. This is accomplished by move constructing the base class, and the contained basic_filebuf. Next basic_istream<charT,traits>::set_rdbuf(&sb) is called to install the contained basic_filebuf.