26 Sep
2016
26 Sep
'16
10:31 p.m.
On 9/26/2016 4:45 PM, alanbirtles2 wrote:
OK, in more detail: the actual offset in a std::streampos is "_Fpos + _Myoff". std::streampos::seekpos returns "_Fpos" std::streamoff(std::streampos) returns "_Myoff + _FPOSOFF(_Fpos)" to get to the desired "_Fpos + _Myoff" we run: std::streampos::seekpos() + std::streamoff(std::streampos) - _FPOSOFF( std::streampos::seekpos() ) which is equivalent to: _Fpos + std::streamoff(std::streampos) - _FPOSOFF( _Fpos ) which is equivalent to: _Fpos + _Myoff + _FPOSOFF(_Fpos) - _FPOSOFF( _Fpos ) the two _FPOSOFF(_Fpos) cancel out to leave the desired: _Fpos + _Myoff
This explanation is clearer to me than your previous shorthand. Thanks !