Namespaces
Variants
Views
Actions

std::basic_istream<CharT,Traits>::sync

From cppreference.com
< cpp‎ | io‎ | basic istream
Revision as of 18:28, 7 August 2012 by Cubbi (Talk | contribs)

 
 
 
 
int sync();

Implementation-defined function. Depending on the implementation and on the type of the associated stream buffer, may empty the get area of rdbuf(), may fill it from the associated input sequence, may do nothing at all, or do something else.

First, constructs a sentry object with noskipws set to true. Afterwards,

if rdbuf() is a null pointer, returns -1

Otherwise, calls rdbuf()->pubsync(). If that function returns -1, calls setstate(badbit) and returns -1. Otherwise, returns 0.

Contents

Parameters

(none)

Return value

0 on success, -1 on failure or if the stream does not support this operation (is unbuffered).

Notes

As with readsome(), it is implementation-defined whether this function does anything with standard streams.

Example

See also

Template:cpp/io/basic streambuf/dcl list syncTemplate:cpp/io/basic ostream/dcl list flush