Title
[networking.ts] net::basic_socket_istream::connect should be constrained
Status
lewg
Section
[socket.iostream.cons][socket.iostream.members]
Submitter
Jonathan Wakely

Created on 2020-05-14.00:00:00 last changed 35 months ago

Messages

Date: 2020-07-17.22:37:26

Proposed resolution:

This wording is relative to N4771.

  1. Modify [socket.iostream.cons] as indicated:

    [Drafting note: As a drive-by fix, a missing std:: qualification in front of forward has been added]

    template<class... Args>
      explicit basic_socket_iostream(Args&&... args);
    

    -4- Effects: Initializes the base class as basic_iostream<char>(&sb_)), value-initializes sb_, and performs setf(std::ios_base::unitbuf). Then calls rdbuf()->connect(std::forward<Args>(args)...). If that function returns a null pointer, calls setstate(failbit).

    -?- Remarks: This function shall not participate in overload resolution unless the expression rdbuf()->connect(std::forward<Args>(args)...) is well-formed.

  2. Modify [socket.iostream.members] as indicated:

    [Drafting note: As a drive-by fix, a missing std:: qualification in front of forward has been added]

    template<class... Args>
      void connect(Args&&... args);
    

    -1- Effects: Calls rdbuf()->connect(std::forward<Args>(args)...). If that function returns a null pointer, calls setstate(failbit) (which may throw ios_base::failure).

    -?- Remarks: This function shall not participate in overload resolution unless the expression rdbuf()->connect(std::forward<Args>(args)...) is well-formed.

Date: 2020-07-15.00:00:00

[ 2020-07-17; Priority set to 3 in telecon ]

Date: 2020-05-14.00:00:00

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.

In addition to that, the basic_socket_iostream(Args&&...) constructor should be constrained, so that is_constructible gives the right answer.

History
Date User Action Args
2021-05-10 16:31:24adminsetstatus: new -> lewg
2020-07-17 22:37:26adminsetmessages: + msg11385
2020-05-16 17:51:21adminsetmessages: + msg11303
2020-05-14 00:00:00admincreate