[syncstream.syncbuf.cons] (original) (raw)

31 Input/output library [input.output]

31.11 Synchronized output streams [syncstream]

31.11.2 Class template basic_syncbuf [syncstream.syncbuf]

31.11.2.2 Construction and destruction [syncstream.syncbuf.cons]

basic_syncbuf(streambuf_type* obuf, const Allocator& allocator);

Effects: Sets wrapped to obuf.

Postconditions: get_wrapped() == obuf andget_allocator() == allocator are true.

Throws: Nothing unless an exception is thrown by the construction of a mutex or by memory allocation.

Remarks: A copy of allocator is used to allocate memory for internal buffers holding the associated output.

basic_syncbuf(basic_syncbuf&& other);

Postconditions: The value returned by this->get_wrapped()is the value returned by other.get_wrapped()prior to calling this constructor.

Output stored in otherprior to calling this constructor will be stored in *this afterwards.

other.pbase() == other.pptr()andother.get_wrapped() == nullptrare true.

Remarks: This constructor disassociates otherfrom its wrapped stream buffer, ensuring destruction of other produces no output.

Throws: Nothing.

If an exception is thrown from emit(), the destructor catches and ignores that exception.