This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of WP status.

### 3002. [networking.ts] `basic_socket_acceptor::is_open()` isn't `noexcept`

Section: 18.9.4 [networking.ts::socket.acceptor.ops] Status: WP Submitter: Jonathan Wakely Opened: 2017-07-14 Last modified: 2021-02-27

Priority: 0

View all issues with WP status.

Discussion:

Addresses: networking.ts

`basic_socket::is_open()` is `noexcept`, but the corresponding function on `basic_socket_acceptor` is not. This is a simple observer with a wide contract and cannot fail.

[ 2017-11-01 Moved to Tentatively Ready after 7 positive votes for P0 on c++std-lib. ]

[2018-3-17 Adopted in Jacksonville]

Proposed resolution:

This resolution is relative to N4656.

1. Edit 18.9 [networking.ts::socket.acceptor], class template `basic_socket_acceptor` synopsis, as indicated:

   >     template<class AcceptableProtocol>
   >     class basic_socket_acceptor {
   >     public:
   >       […]
   >       bool is_open() const noexcept;
   >       […]
   >     };

2. Edit 18.9.4 [networking.ts::socket.acceptor.ops] as indicated:

   >     bool is_open() const noexcept;

   > > -10- Returns: A `bool` indicating whether this acceptor was opened by a previous call to `open` or `assign`.