std::basic_istream<CharT,Traits>::sync
From cppreference.com
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
This section is incomplete Reason: no example |