30 Input/output library [input.output]

30.6 Stream buffers [stream.buffers]

30.6.3 Class template basic_­streambuf [streambuf] basic_­streambuf constructors [streambuf.cons]


Effects: Constructs an object of class basic_­streambuf<charT, traits> and initializes:299

  • all its pointer member objects to null pointers,

  • the getloc() member to a copy the global locale, locale(), at the time of construction.

Remarks: Once the getloc() member is initialized, results of calling locale member functions, and of members of facets so obtained, can safely be cached until the next time the member imbue is called.

basic_streambuf(const basic_streambuf& rhs);

Effects: Constructs a copy of rhs.


  • eback() == rhs.eback()

  • gptr() == rhs.gptr()

  • egptr() == rhs.egptr()

  • pbase() == rhs.pbase()

  • pptr() == rhs.pptr()

  • epptr() == rhs.epptr()

  • getloc() == rhs.getloc()


Effects: None.

The default constructor is protected for class basic_­streambuf to assure that only objects for classes derived from this class may be constructed.