[ios.members.static] (original) (raw)

31 Input/output library [input.output]

31.5 Iostreams base classes [iostreams.base]

31.5.2 Class ios_base [ios.base]

31.5.2.5 Static members [ios.members.static]

static bool sync_with_stdio(bool sync = true);

Effects: If any input or output operation has occurred using the standard streams prior to the call, the effect isimplementation-defined.

Otherwise, called with a false argument, it allows the standard streams to operate independently of the standard C streams.

Returns: trueif the previous state of the standard iostream objectswas synchronized and otherwise returnsfalse.

The first time it is called, the function returnstrue.

Remarks: When a standard iostream object str is_synchronized_with a standard stdio stream f, the effect of inserting a character c byfputc(f, c);is the same as the effect ofstr.rdbuf()->sputc(c);for any sequences of characters; the effect of extracting a character c byc = fgetc(f);is the same as the effect ofc = str.rdbuf()->sbumpc();for any sequences of characters; and the effect of pushing back a character c byungetc(c, f);is the same as the effect ofstr.rdbuf()->sputbackc(c);for any sequence of characters.260