What Does filebuf::sync Do on an Input Buffer?

158 Views Asked by At

I read here that, for an input buffer, filebuf::sync's:

effects -if any- depend on the library implementation

So my question then, is can anyone tell me what those effects are for gcc and Visual Studio?

1

There are 1 best solutions below

2
On

GCC's internal implementation of basic_filebuf simply aligns its pbase() and pptr() with the comment:

Make sure that the internal buffer resyncs its idea of file position with the external file.

Visual Studio's internal implementation of basic_filebuf calls fflush(_Myfile) which is not implemented in the header. So it's unclear what that call does. The call is commented with:

synchronize C stream with external file