0

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?

Jonathan Mee
  • 37,899
  • 23
  • 129
  • 288

1 Answers1

0

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

edmz
  • 8,220
  • 2
  • 26
  • 45
Jonathan Mee
  • 37,899
  • 23
  • 129
  • 288