Namespaces
Variants
Views
Actions

Difference between revisions of "cpp/io/manip/unitbuf"

From cppreference.com
< cpp‎ | io‎ | manip
(+)
 
m (-whitespace)
Line 18: Line 18:
  
 
This is an I/O manipulator, it may be called with an expression such as {{cpp|out << std::unitbuf}} for any {{tt|out}} of type {{cpp|std::basic_ostream}} or with an expression such as {{cpp|in >> std::unitbuf}} for any {{tt|in}} of type {{cpp|std::basic_istream}}.
 
This is an I/O manipulator, it may be called with an expression such as {{cpp|out << std::unitbuf}} for any {{tt|out}} of type {{cpp|std::basic_ostream}} or with an expression such as {{cpp|in >> std::unitbuf}} for any {{tt|in}} of type {{cpp|std::basic_istream}}.
 
  
 
===Notes===
 
===Notes===

Revision as of 11:09, 11 January 2012

Template:cpp/io/manip/sidebar Template:ddcl list begin <tr class="t-dsc-header">

<td>
Defined in header <ios>
</td>

<td></td> <td></td> </tr> <tr class="t-dcl ">

<td >
std::ios_base& unitbuf( std::ios_base& str );
</td>

<td > (1) </td> <td class="t-dcl-nopad"> </td> </tr> <tr class="t-dcl ">

<td >
std::ios_base& nounitbuf( std::ios_base& str );
</td>

<td > (2) </td> <td class="t-dcl-nopad"> </td> </tr> Template:ddcl list end

Enables or disables automatic flushing of the output stream after any output operation. Has no effect on input.

1) enables the unitbuf flag in the stream str as if by calling Template:cpp

2) disables the unitbuf flag in the stream str as if by calling Template:cpp

This is an I/O manipulator, it may be called with an expression such as Template:cpp for any out of type Template:cpp or with an expression such as Template:cpp for any in of type Template:cpp.

Contents

Notes

Flushing is performed in the destructor of the Template:cpp object, which calls Template:cpp if Template:cpp.

The standard output objects Template:cpp and Template:cpp have their unitbuf bit set by default.

Parameters

str - reference to I/O stream

Return value

str (reference to the stream after manipulation)

Example

Template:example cpp

See also

Template:cpp/io/manip/dcl list flushTemplate:cpp/io/manip/dcl list endl