This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of LEWG status.
net::basic_socket_istream::connect
should be constrainedSection: 19.2.1 [networking.ts::socket.iostream.cons], 19.2.2 [networking.ts::socket.iostream.members] Status: LEWG Submitter: Jonathan Wakely Opened: 2020-05-14 Last modified: 2021-05-10
Priority: 3
View all other issues in [networking.ts::socket.iostream.cons].
View all issues with LEWG status.
Discussion:
Addresses: networking.ts
basic_socket_streambuf<P, C, W>::connect(Args&&...)
is constrained to only exist when
P
meets the InternetProtocol
requirements, but basic_socket_iostream<P, C, W>::connect(Args&&...)
is not constrained. Since it just passes those arguments straight to the streambuf
, the outer
connect(Args&&...)
should be constrained too.
basic_socket_iostream(Args&&...)
constructor should be constrained, so that
is_constructible
gives the right answer.
[2020-07-17; Priority set to 3 in telecon]
Proposed resolution:
This wording is relative to N4771.
Modify 19.2.1 [networking.ts::socket.iostream.cons] as indicated:
[Drafting note: As a drive-by fix, a missing
std::
qualification in front offorward
has been added]
template<class... Args> explicit basic_socket_iostream(Args&&... args);-4- Effects: Initializes the base class as
-?- Remarks: This function shall not participate in overload resolution unless the expressionbasic_iostream<char>(&sb_))
, value-initializessb_
, and performssetf(std::ios_base::unitbuf)
. Then callsrdbuf()->connect(std::forward<Args>(args)...)
. If that function returns a null pointer, callssetstate(failbit)
.rdbuf()->connect(std::forward<Args>(args)...)
is well-formed.
Modify 19.2.2 [networking.ts::socket.iostream.members] as indicated:
[Drafting note: As a drive-by fix, a missing
std::
qualification in front offorward
has been added]
template<class... Args> void connect(Args&&... args);-1- Effects: Calls
-?- Remarks: This function shall not participate in overload resolution unless the expressionrdbuf()->connect(std::forward<Args>(args)...)
. If that function returns a null pointer, callssetstate(failbit)
(which may throwios_base::failure
).rdbuf()->connect(std::forward<Args>(args)...)
is well-formed.