Files
2025-10-25 03:02:53 +03:00

2.6 KiB

[syncstream.syncbuf.cons]

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);

1

#

Effects: Sets wrapped to obuf.

2

#

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

3

#

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

4

#

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

🔗

basic_syncbuf(basic_syncbuf&& other);

5

#

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

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

other.pbase() == other.pptr() andother.get_wrapped() == nullptr are true.

6

#

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

🔗

~basic_syncbuf();

7

#

Effects: Calls emit().

8

#

Throws: Nothing.

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