std::basic_istream::sync

From cppreference.com
int sync();

Fills the input cache buffer with data from the underlying input device.

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

[edit] Parameters

(none)

[edit] Return value

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

[edit] Notes

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

[edit] Example

[edit] See also

synchronizes with the underlying storage device
(public member function of std::basic_ostream)