basic_fstream::basic_fstream

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

The first constructor initializes the base class by calling basic_iostream(sb), where sb is the stored object of class basic_filebuf<E, T>. It also initializes sb by calling basic_filebuf<E, T>().

The second constructor initializes the base class by calling basic_iostream(sb). It also initializes sb by calling basic_filebuf<E, T>(), then sb.open(s, mode). If the latter function returns a null pointer, the constructor calls setstate(failbit).