Is std::streampos guaranteed to be unsigned long long?
问题 Is std::streampos guaranteed to be unsigned long long ? If not so, how does std::istream::seekg work correctly on files larger than 4G? 回答1: From http://en.cppreference.com/w/cpp/io/fpos: std::streampos is a specialization of the class template template< class State > class fpos; std::streampos is typedef'ed to be std::fpos<std::char_traits<char>::state_type> Each object of type fpos holds the byte position in the stream (typically as a private member of type std::streamoff ). From http://en