value_type
buffer sequence requirementSection: 16.2 [networking.ts::buffer.reqmts] Status: C++23 Submitter: Vinnie Falco Opened: 2017-09-20 Last modified: 2023-11-22
Priority: 0
View all other issues in [networking.ts::buffer.reqmts].
View all issues with C++23 status.
Discussion:
Addresses: networking.ts
The post-condition requirements for ConstBufferSequence
and MutableBufferSequence
refer to X::value_type
,
but no such nested type is required. The lambda expression passed to equal
can use auto const&
parameter types
instead.
This wording is relative to N4588.
Modify 16.2.1 [networking.ts::buffer.reqmts.mutablebuffersequence] Table 12 "
MutableBufferSequence
requirements" as indicated:
Table 12 — MutableBufferSequence
requirementsexpression return type assertion/note pre/post-condition […]
X u(x);
post:
equal( net::buffer_sequence_begin(x), net::buffer_sequence_end(x), net::buffer_sequence_begin(u), net::buffer_sequence_end(u), [](consttypename X::value_typeauto& v1, consttypename X::value_typeauto& v2) { mutable_buffer b1(v1); mutable_buffer b2(v2); return b1.data() == b2.data() && b1.size() == b2.size(); })Modify 16.2.2 [networking.ts::buffer.reqmts.constbuffersequence] Table 13 "
ConstBufferSequence
requirements" as indicated:
Table 13 — ConstBufferSequence
requirementsexpression return type assertion/note pre/post-condition […]
X u(x);
post:
equal( net::buffer_sequence_begin(x), net::buffer_sequence_end(x), net::buffer_sequence_begin(u), net::buffer_sequence_end(u), [](consttypename X::value_typeauto& v1, consttypename X::value_typeauto& v2) { const_buffer b1(v1); const_buffer b2(v2); return b1.data() == b2.data() && b1.size() == b2.size(); })
[2017-10-19, Peter Dimov provides improved wording]
The alternative wording prevents the need for auto
parameters because it takes advantage of the "convertible to"
requirement.
[ 2017-10-20 Moved to Tentatively Ready after 5 positive votes on c++std-lib. ]
[2018-3-17 Adopted in Jacksonville]
Proposed resolution:
This wording is relative to N4588.
Modify 16.2.1 [networking.ts::buffer.reqmts.mutablebuffersequence] Table 12 "MutableBufferSequence
requirements" as indicated:
Table 12 — MutableBufferSequence
requirementsexpression return type assertion/note pre/post-condition […]
X u(x);
post:
equal( net::buffer_sequence_begin(x), net::buffer_sequence_end(x), net::buffer_sequence_begin(u), net::buffer_sequence_end(u), [](consttypename X::value_type& v1mutable_buffer& b1, consttypename X::value_type& v2mutable_buffer& b2) {mutable_buffer b1(v1); mutable_buffer b2(v2);return b1.data() == b2.data() && b1.size() == b2.size(); })
Modify 16.2.2 [networking.ts::buffer.reqmts.constbuffersequence] Table 13 "ConstBufferSequence
requirements" as indicated:
Table 13 — ConstBufferSequence
requirementsexpression return type assertion/note pre/post-condition […]
X u(x);
post:
equal( net::buffer_sequence_begin(x), net::buffer_sequence_end(x), net::buffer_sequence_begin(u), net::buffer_sequence_end(u), [](consttypename X::value_type& v1const_buffer& b1, consttypename X::value_type& v2const_buffer& v2) {const_buffer b1(v1); const_buffer b2(v2);return b1.data() == b2.data() && b1.size() == b2.size(); })