This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of C++11 status.
POS_T and OFF_TSection: 27.2.4.4 [char.traits.specializations.char16.t] Status: C++11 Submitter: BSI Opened: 2010-08-25 Last modified: 2021-06-06
Priority: Not Prioritized
View all other issues in [char.traits.specializations.char16.t].
View all issues with C++11 status.
Duplicate of: 1444
Discussion:
Addresses GB-109, GB-123
It is not clear what the specification means for
u16streampos, u32streampos or wstreampos when they
refer to the requirements for POS_T in 21.2.2, as there
are no longer any such requirements. Similarly the annex
D.7 refers to the requirements of type POS_T in 27.3 that
no longer exist either.
Clarify the meaning of all cross-reference to the
removed type POS_T.
[ Post-Rapperswil, Daniel provides the wording. ]
When preparing the wording for this issue I first thought about adding both u16streampos and u32streampos
to the [iostream.forward] header <iosfwd> synopsis similar to streampos and wstreampos,
but decided not to do so, because the IO library does not yet actively support the char16_t and char32_t
character types. Adding those would misleadingly imply that they would be part of the iostreams. Also, the addition
would make them also similarly equal to a typedef to fpos<mbstate_t>, as for streampos and
wstreampos, so there is no loss for users that would like to use the proper fpos instantiation for
these character types.
Additionally the way of referencing was chosen to follow the style suggested by NB comment GB 108.
Moved to Tentatively Ready with proposed wording after 5 positive votes on c++std-lib.
[ Adopted at 2010-11 Batavia ]
Proposed resolution:
The following wording changes are against N3126.
Change [char.traits.specializations.char16_t]p.1 as indicated:
1 - The type
u16streamposshall be an implementation-defined type that satisfies the requirements forPOS_Tin 21.2.2pos_typein [iostreams.limits.pos].
Change [char.traits.specializations.char32_t]p.1 as indicated:
1 - The type
u32streamposshall be an implementation-defined type that satisfies the requirements forPOS_Tin 21.2.2pos_typein [iostreams.limits.pos].
Change [char.traits.specializations.wchar.t]p.2 as indicated:
2 - The type
wstreamposshall be an implementation-defined type that satisfies the requirements forPOS_Tin 21.2.2pos_typein [iostreams.limits.pos].
Change [fpos.operations], Table 124 — Position type requirements as indicated:
Table 124 — Position type requirements Expression Return type ............O(p)OFF_Tstreamoff... .........o = p - qOFF_Tstreamoff...streamsize(o)O(sz)streamsizeOFF_Tstreamoff...
Change [depr.ios.members]p.1 as indicated:
namespace std {
class ios_base {
public:
typedef T1 io_state;
typedef T2 open_mode;
typedef T3 seek_dir;
typedef OFF_Timplementation-defined streamoff;
typedef POS_Timplementation-defined streampos;
// remainder unchanged
};
}
Change [depr.ios.members]p.5+6 as indicated:
5 - The type
streamoffis an implementation-defined type that satisfies the requirements oftypeOFF_T(27.5.1)off_typein [iostreams.limits.pos].6 - The type
streamposis an implementation-defined type that satisfies the requirements oftypePOS_T(27.3)pos_typein [iostreams.limits.pos].