Created on 2018-02-26.00:00:00 last changed 13 months ago
Proposed resolution:
This wording is relative to N4711.
Change [buffer.read.until] as indicated:
template<class SyncReadStream, class DynamicBuffer> size_t read_until(SyncReadStream& s, DynamicBuffer&& b, char delim); template<class SyncReadStream, class DynamicBuffer> size_t read_until(SyncReadStream& s, DynamicBuffer&& b, char delim, error_code& ec); template<class SyncReadStream, class DynamicBuffer> size_t read_until(SyncReadStream& s, DynamicBuffer&& b, string_view delim); template<class SyncReadStream, class DynamicBuffer> size_t read_until(SyncReadStream& s, DynamicBuffer&& b, string_view delim, error_code& ec);-1- Effects: Reads data from the buffer-oriented synchronous read stream ([buffer.stream.reqmts.syncreadstream]) object stream by performing zero or more calls to the stream's read_some member function, until the
-2- Data is placed into the dynamic buffer object b. A mutable buffer sequence (16.2.1) is obtained prior to each read_some call using b.prepare(N), where N is an unspecified value such that N <= max_size() - size(). [Note: Implementations are encouraged to use b.capacity() when determining N, to minimize the number of read_some calls performed on the stream. — end note] After each read_some call, the implementation performs b.commit(n), where n is the return value from read_some. -3- The synchronous read_until operation continues until:input sequencereadable bytes of the dynamic buffer ([buffer.reqmts.dynamicbuffer]) object b containsthe specified delimiter delim.-4- On exit, if the
(3.1) — the
input sequencereadable bytes of b containsthe delimiter delim; or(3.2) — b.size() == b.max_size(); or
(3.3) — an asynchronous read_some operation fails.
input sequencereadable bytes of b containsthe delimiter, ec is set such that !ec is true. Otherwise, if b.size() == b.max_size(), ec is set such that ec == stream_errc::not_found. If b.size() < b.max_size(), ec contains the error_code from the most recent read_some call. -5- Returns: The number ofbytes in the input sequence ofreadable bytes in b up to and including the delimiter, if present. [Note: On completion, the buffer may contain additional bytes following the delimiter. — end note] Otherwise returns 0.
[ 2018-06 Rapperswil: Adopted ]
[ 2018-03-06 Moved to Tentatively Ready after 5 positive votes on c++std-lib. ]
When specifying DynamicBuffers and their related operations, early drafts of the Networking TS described the buffers in terms of their "input sequence" and "output sequence". This was changed to "readable bytes" and "writable bytes" respectively. Unfortunately, some instances of "input sequence" were missed in section [buffer.read.until].
History | |||
---|---|---|---|
Date | User | Action | Args |
2023-11-22 15:47:43 | admin | set | status: wp -> c++23 |
2021-02-27 12:43:20 | admin | set | status: c++20 -> wp |
2021-02-25 10:48:01 | admin | set | status: wp -> c++20 |
2018-06-12 01:05:16 | admin | set | messages: + msg9884 |
2018-06-12 01:05:16 | admin | set | status: voting -> wp |
2018-05-06 19:23:13 | admin | set | status: ready -> voting |
2018-03-07 17:16:45 | admin | set | messages: + msg9714 |
2018-03-07 17:16:45 | admin | set | status: new -> ready |
2018-03-04 10:33:48 | admin | set | messages: + msg9701 |
2018-02-26 00:00:00 | admin | create |