Created on 2022-05-07.00:00:00 last changed 2 weeks ago
Proposed resolution:
This wording is relative to N5008.
Modify [stream.types] as indicated:
using streamoff = implementation-defined;-1- The type `streamoff` is a synonym for one of the signed
basicintegral types of sufficient size to represent the maximum possible file size for the operating system.256using streamsize = implementation-defined;-2- The type `streamsize` is a synonym for one of the signed
basicintegral types. It is used to represent the number of characters transferred in an I/O operation, or the size of I/O buffers.257256) Typically `long long`.
257) Most places where `streamsize` is used would use `size_t` in C, or `ssize_t` in POSIX.
[ 2025-06-16; Jonathan adds wording ]
[ 2022-05-17; Reflector poll ]
Set priority to 3 after reflector poll.
Raised from editorial issue #5240.
The phrase "signed basic integral types" in [stream.types] has been present since C++98 but never defined. It is unclear whether "basic integral types" are "standard integer types" or "integer types" (including extended integer types). As std::streamoff should be wide enough to represent the largest possible file size, and std::uintmax_t is used as the return type of std::filesystem::file_size, we should not disallow std::streamoff to be an extended integer type which may be wider than long long. On the other hand, as std::size_t and std::ptrdiff_t have already been allowed to be extended integer types, std::streamsize should also be allowed to be an extended integer type for consistency. So I think we should just use "signed integer types" instead of "signed basic integral types" in [stream.types].History | |||
---|---|---|---|
Date | User | Action | Args |
2025-06-16 11:24:24 | admin | set | messages: + msg14833 |
2025-06-16 11:24:24 | admin | set | messages: + msg14832 |
2022-05-17 11:58:16 | admin | set | messages: + msg12467 |
2022-05-07 00:00:00 | admin | create |