30 Input/output library [input.output]

30.8 String-based streams [string.streams]

30.8.2 Class template basic_­stringbuf [stringbuf]

30.8.2.1 basic_­stringbuf constructors [stringbuf.cons]

explicit basic_stringbuf( ios_base::openmode which = ios_base::in | ios_base::out);

Effects: Constructs an object of class basic_­stringbuf, initializing the base class with basic_­streambuf() ([streambuf.cons]), and initializing mode with which.

Postconditions: str() == "".

explicit basic_stringbuf( const basic_string<charT, traits, Allocator>& s, ios_base::openmode which = ios_base::in | ios_base::out);

Effects: Constructs an object of class basic_­stringbuf, initializing the base class with basic_­streambuf() ([streambuf.cons]), and initializing mode with which. Then calls str(s).

basic_stringbuf(basic_stringbuf&& rhs);

Effects: Move constructs from the rvalue rhs. 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. 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.

  • str() == rhs_­p.str()

  • 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()