The pointers are not different, and the internal call to
seekpos(pos_type __pos, ios_base::openmode)
is ignoring the openmode parameter. The implementation for Microsoft VC and gcc both ignore it. I found a comment in the fstream source for gcc
which lead me to the Defect Report, DR 171, see pdf
here[
^] and scoll down to (or seach for) 171 on page 35.
In short it suggests that implementations should look for the openmode sent to the call to open() instead of the call to seekpos(). Hence the somewhat unintuitive behavior.
Edit: missed a '
not'
According to the
basic_filebuf
specification: "A joint file position is maintained for both the input sequence and the output sequence"