Section

std::fpos

Specializations of the class template std::fpos identify absolute positions in a stream or in a file. Each object of type fpos holds the byte position in the stream (typically as a private member of type std::streamoff) and the current shift state, a value of type State (typically std::mbstate_t).

# Declarations

template< class State >
class fpos;

# Notes

Some of the I/O streams member functions return and manipulate objects of member typedef pos_type. For streams, these member typedefs are provided by the template parameter Traits, which defaults to std::char_traits, which define their pos_types to be specializations of std::fpos. The behavior of the I/O streams library is implementation-defined when Traits::pos_type is not std::fpos<std::mbstate_t> (aka std::streampos, std::wstreampos, etc.).

# Defect reports

DRApplied toBehavior as publishedCorrect behavior
LWG 57C++98streampos and wstreampos were contradictionallyallowed to be different while required to be the sameclarified tobe the same
P0759R1C++98specification was unclear and incompletecleaned up
P1148R0C++11unclear what and in which header thedefinitions u16streampos and u32streampos aremade clear
LWG 2114(P2167R3)C++98non-bool return types of equality comparisons were alloweddisallowed

# See also