Title
[networking.ts] net::basic_socket_iostream should use addressof
Status
c++23
Section
[socket.iostream.cons]
Submitter
Jonathan Wakely

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

Messages

Date: 2020-11-09.22:17:46

Proposed resolution:

This wording is relative to N4771.

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

    basic_socket_iostream();
    

    -1- Effects: Initializes the base class as basic_iostream<char>(&addressof(sb_)), value-initializes sb_, and performs setf(std::ios_base::unitbuf).

    explicit basic_socket_iostream(basic_stream_socket<protocol_type> s);
    

    -2- Effects: Initializes the base class as basic_iostream<char>(&addressof(sb_)), initializes sb_ with std::move(s), and performs setf(std::ios_base::unitbuf).

    basic_socket_iostream(basic_socket_iostream&& rhs);
    

    -3- Effects: Move constructs from the rvalue rhs. This is accomplished by move constructing the base class, and the contained basic_socket_streambuf. Next basic_iostream<char>::set_rdbuf(&addressof(sb_)) is called to install the contained basic_socket_streambuf.

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

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

Date: 2020-11-09.00:00:00

[ 2020-11-09 Approved In November virtual meeting. Status changed: Ready → WP. ]

Date: 2020-07-15.00:00:00

[ 2020-07-17; Moved to Ready in telecon ]

Jens suggested we should have blanket wording saying that when the library uses the & operator, it means std::addressof.

Date: 2020-05-14.00:00:00

Addresses: networking.ts

[socket.iostream.cons] uses &sb_ which could find something bad via ADL.

History
Date User Action Args
2023-11-22 15:47:43adminsetstatus: wp -> c++23
2021-02-27 12:43:20adminsetstatus: c++20 -> wp
2021-02-25 10:48:01adminsetstatus: wp -> c++20
2020-11-09 22:17:46adminsetmessages: + msg11604
2020-11-09 22:17:46adminsetstatus: ready -> wp
2020-07-17 22:37:26adminsetmessages: + msg11393
2020-07-17 22:37:26adminsetstatus: new -> ready
2020-05-16 17:27:06adminsetmessages: + msg11300
2020-05-14 00:00:00admincreate