共用方式為


unitbuf

Causes output to be processed when the buffer is not empty.

ios_base& unitbuf( 
   ios_base& _Str 
);

Parameters

  • _Str
    A reference to an object of type ios_base, or to a type that inherits from ios_base.

Return Value

A reference to the object from which _Str is derived.

Remarks

Note that endl also flushes the buffer.

nounitbuf is in effect by default.

The manipulator effectively calls _Str.setf(ios_base::unitbuf), and then returns _Str.

Requirements

Header: <ios>

Namespace: std

See Also

Reference

iostream Programming

iostreams Conventions