std::basic_syncbuf<CharT,Traits,Allocator>::basic_syncbuf
From cppreference.com
< cpp | io | basic syncbuf
C++
Feature test macros (C++20)
Concepts library (C++20)
Metaprogramming library (C++11)
Ranges library (C++20)
Filesystem library (C++17)
Concurrency support library (C++11)
Execution control library (C++26)
Input/output library
Print functions (C++23)
Buffers
(C++23)
(C++98/26*)
(C++20)
Streams
Abstractions
File I/O
String I/O
Array I/O
(C++23)
(C++23)
(C++23)
(C++98/26*)
(C++98/26*)
(C++98/26*)
Synchronized Output
(C++20)
Types
Error category interface
(C++11)
(C++11)
std::basic_syncbuf
Public member functions
basic_syncbuf::basic_syncbuf
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
Protected member functions
(C++20)
Non-member functions
(C++20)
basic_syncbuf()
: basic_syncbuf( nullptr )
(1)
: basic_syncbuf( nullptr )
explicit basic_syncbuf( streambuf_type* obuf )
: basic_syncbuf( obuf, Allocator() ) {}
(2)
: basic_syncbuf( obuf, Allocator() ) {}
basic_syncbuf( streambuf_type* obuf, const Allocator& a );
(3)
basic_syncbuf( basic_syncbuf&& rhs );
(4)
1) Default constructor: creates an instance of
std::basic_syncbuf
with emit-on-sync policy set to false, wrapped streambuffer set to nullptr, and using default-constructed Allocator
as the allocator for temporary storage.2,3) Creates an instance of
std::basic_syncbuf
with emit-on-sync policy set to false, wrapped streambuffer set to obuf, and using a as the allocator for temporary storage.4) Move constructor: move-constructs a
std::basic_syncbuf
object by moving all contents from another std::basic_syncbuf
object rhs, including the temporary storage, the wrapped stream pointer, policy, and all other state (such as the mutex pointer). After move, rhs is not associated with a stream, and rhs.get_wrapped() == nullptr. The put area member pointers of the base class std::basic_streambuf of rhs are guaranteed to be null. Destroying a moved-from rhs will not produce any output.Contents
[edit] Parameters
obuf
-
pointer to the std::basic_streambuf to wrap
a
-
the allocator to use for temporary storage
rhs
-
another
std::basic_syncbuf
to move from
[edit] Exceptions
2,3) May throw std::bad_alloc from the constructor of the internal temporary storage or std::system_error from the mutex construction.
[edit] Notes
Typically called by the appropriate constructors of std::basic_osyncstream.
[edit] Example
This section is incomplete
Reason: no example
Reason: no example
[edit] See also
[virtual]
(virtual protected member function of
std::basic_streambuf<CharT,Traits>
) [edit]