This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of C++23 status.
read_until still refers to "input sequence"Section: 17.9 [networking.ts::buffer.read.until] Status: C++23 Submitter: Christopher Kohlhoff Opened: 2018-02-26 Last modified: 2023-11-22
Priority: 0
View all issues with C++23 status.
Discussion:
Addresses: networking.ts
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
17.9 [networking.ts::buffer.read.until].
[ 2018-03-06 Moved to Tentatively Ready after 5 positive votes on c++std-lib. ]
[2018-06 Rapperswil: Adopted]
Proposed resolution:
This wording is relative to N4711.
Change 17.9 [networking.ts::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 (17.1.1 [networking.ts::buffer.stream.reqmts.syncreadstream]) object stream by performing zero or more calls to the stream's
-2- Data is placed into the dynamic buffer object b. A mutable buffer sequence (16.2.1) is obtained prior to eachread_somemember function, until theinput sequencereadable bytes of the dynamic buffer (16.2.4 [networking.ts::buffer.reqmts.dynamicbuffer]) objectbcontainsthe specified delimiterdelim.read_somecall usingb.prepare(N), whereNis an unspecified value such thatN <= max_size() - size(). [Note: Implementations are encouraged to useb.capacity()when determiningN, to minimize the number ofread_somecalls performed on the stream. — end note] After eachread_somecall, the implementation performsb.commit(n), wherenis the return value fromread_some. -3- The synchronousread_untiloperation continues until:-4- On exit, if the
(3.1) — the
input sequencereadable bytes ofbcontainsthe delimiterdelim; or(3.2) —
b.size() == b.max_size(); or(3.3) — an asynchronous
read_someoperation fails.input sequencereadable bytes ofbcontainsthe delimiter,ecis set such that!ecistrue. Otherwise, ifb.size() == b.max_size(),ecis set such thatec == stream_errc::not_found. Ifb.size() < b.max_size(),eccontains theerror_codefrom the most recentread_somecall. -5- Returns: The number ofbytes in the input sequence ofreadable bytes inbup to and including the delimiter, if present. [Note: On completion, the buffer may contain additional bytes following the delimiter. — end note] Otherwise returns0.