Namespaces
Variants

std::basic_osyncstream<CharT,Traits,Allocator>::basic_osyncstream

From cppreference.com
Revision as of 21:28, 26 December 2017 by Cubbi (talk | contribs) (Created page with "{{cpp/io/basic_osyncstream/title | basic_osyncstream}} {{cpp/io/basic_osyncstream/navbar}} {{dcl begin}} {{dcl | num=1 | 1= basic_osyncstream( streambuf_type* buf, const Alloc...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
 
 
 
 
basic_osyncstream( streambuf_type* buf, const Allocator& a);
(1)
explicit basic_osyncstream( streambuf_type* buf )
: basic_osyncstream( buf, Allocator() ) {}
(2)
basic_osyncstream( std::basic_ostream<CharT, Traits>& os, const Allocator& a)
: basic_osyncstream( os.rdbuf(), a) {}
(3)
explicit basic_osyncstream( std::basic_ostream<CharT, Traits>& os )
: basic_osyncstream( os, Allocator() ) {}
(4)
basic_osyncstream( std::basic_osyncstream&& other) noexcept;
(5)

Constructs new synchronized output stream

1-4) constructs the private member std::basic_syncbuf using the buffer and the allocator provided, and initializes the base class with a pointer to the member std::basic_streambuf.
5) Move constructor. Move-constructs the base class and the wrapped std::basic_syncbuf from the corresponding subobjects of other, then calls basic_ostream::set_rdbuf with the pointer to the newly-constructed wrapped std::basic_syncbuf. After this move constructor, other.get_wrapped() returns nullptr.

Parameters

buf - pointer to the std::basic_streambuf that will be wrapped
os - reference to a std::basic_ostream, whose rdbuf() will be wrapped
a - the allocator to pass to the constructor of the member std::basic_syncbuf
other - another osyncstream to move from

Example

See also

constructs a basic_syncbuf object
(public member function of std::basic_syncbuf<CharT,Traits,Allocator>) [edit]