29 Input/output library [input.output]

29.9 File-based streams [file.streams]

29.9.2 Class template basic_­filebuf [filebuf]

29.9.2.2 Constructors [filebuf.cons]

basic_filebuf();
Effects: Initializes the base class with basic_­streambuf<charT, traits>() ([streambuf.cons]).
Postconditions: is_­open() == false.
basic_filebuf(basic_filebuf&& rhs);
Effects: It is implementation-defined whether the sequence pointers in *this (eback(), gptr(), egptr(), pbase(), pptr(), epptr()) obtain the values which rhs had.
Whether they do or not, *this and rhs reference separate buffers (if any at all) after the construction.
Additionally *this references the file which rhs did before the construction, and rhs references no file after the construction.
The openmode, locale and any other state of rhs is also copied.
Postconditions: Let rhs_­p refer to the state of rhs just prior to this construction and let rhs_­a refer to the state of rhs just after this construction.
  • is_­open() == rhs_­p.is_­open()
  • rhs_­a.is_­open() == false
  • gptr() - eback() == rhs_­p.gptr() - rhs_­p.eback()
  • egptr() - eback() == rhs_­p.egptr() - rhs_­p.eback()
  • pptr() - pbase() == rhs_­p.pptr() - rhs_­p.pbase()
  • epptr() - pbase() == rhs_­p.epptr() - rhs_­p.pbase()
  • if (eback()) eback() != rhs_­a.eback()
  • if (gptr()) gptr() != rhs_­a.gptr()
  • if (egptr()) egptr() != rhs_­a.egptr()
  • if (pbase()) pbase() != rhs_­a.pbase()
  • if (pptr()) pptr() != rhs_­a.pptr()
  • if (epptr()) epptr() != rhs_­a.epptr()
virtual ~basic_filebuf();
Effects: Calls close().
If an exception occurs during the destruction of the object, including the call to close(), the exception is caught but not rethrown (see [res.on.exception.handling]).