inline stream_offset position_to_offset(std::streampos pos) { // use implementation-specific member function get_fpos_t(). return fpos_t_to_offset(pos.get_fpos_t()) + stream_offset(std::streamoff(pos)) - stream_offset(std::streamoff(pos.get_fpos_t())); }
inline stream_offset position_to_offset(std::streampos pos) { return fpos_t_to_offset(streampos_to_fpos_t(pos)) + static_cast<stream_offset>( static_cast<std::streamoff>(pos) - _FPOSOFF(streampos_to_fpos_t(pos)) ); }