template< class State >
class 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).
The following typedef names for std::fpos<std::mbstate_t> are provided (although they are spelled differently in the standard, they denote the same type):
All specializations of fpos
meet the DefaultConstructible, CopyConstructible, CopyAssignable, Destructible, and EqualityComparable requirements.
If State
is trivially copy constructible, fpos
has a trivial copy constructor. If State
is trivially copy assignable, fpos
has a trivial copy assignment operator. If State
is trivially destructible, fpos
has a trivial destructor.
In addition, member and non-member functions are provided to support the following operations:
std::fpos
constructed in this manner is returned by some stream operations to indicate errors.fpos
to std::streamoff. The result is the stored offset.std::fpos
and return a bool prvalue. p != q is equivalent to !(p == q).fpos<State>
and an object o of type (possibly const) std::streamofffpos<State>
and stores an offset that is the result of adding o to the offset of p.fpos<State>
and the result of the conversion is equal to p + o.fpos<State>
and stores an offset that is the result of subtracting o from the offset of p.std::fpos
producing an std::streamoff, such that for two such objects p and q, p == q + (p - q).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_type
s 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.).
The following behavior-changing defect reports were applied retroactively to previously published C++ standards.
DR Applied to Behavior as published Correct behavior LWG 57 C++98streampos
and wstreampos
were contradictionally
u16streampos
and u32streampos
are made clear LWG 2114
std::basic_ostream<CharT,Traits>
) [edit] sets the output position indicator
std::basic_ostream<CharT,Traits>
) [edit] gets the file position indicator
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4