GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
std::ostreambuf_iterator::ostreambuf_iterator(3) C++ Standard Libary std::ostreambuf_iterator::ostreambuf_iterator(3)

std::ostreambuf_iterator::ostreambuf_iterator - std::ostreambuf_iterator::ostreambuf_iterator


ostreambuf_iterator( streambuf_type* buffer ) (until C++11)
throw();
ostreambuf_iterator( streambuf_type* buffer ) (since C++11)
noexcept; (1)
ostreambuf_iterator( ostream_type& stream ) (until C++11)
throw(); (2)
ostreambuf_iterator( ostream_type& stream ) (since C++11)
noexcept;


1) Constructs the iterator with the private streambuf_type* member set to buffer and
the failed() flag set to false. The behavior is undefined if buffer is a null
pointer.
2) Same as ostreambuf_iterator(stream.rdbuf()).


stream - the output stream whose rdbuf() will be accessed by this iterator
buffer - the output stream buffer to be accessed by this iterator

// Run this code


#include <iostream>
#include <fstream>
#include <iterator>
int main()
{
std::basic_filebuf<char> f;
f.open("test.txt", std::ios::out);


std::ostreambuf_iterator<char> out1(&f);


std::ostreambuf_iterator<wchar_t> out2(std::wcout);


*out1 = 'a';
*out2 = L'a';
}


Defect reports


The following behavior-changing defect reports were applied retroactively to
previously published C++ standards.


DR Applied to Behavior as published Correct behavior
default constructor was provided as C++20 removed along with the
P2325R3 C++20 iterators requirement
must be default_initializable

2022.07.31 http://cppreference.com

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.