Title
[networking.ts] service_already_exists has no usable constructors
Status
c++23
Section
[async.exec.ctx]
Submitter
Jonathan Wakely

Created on 2020-03-17.00:00:00 last changed 12 months ago

Messages

Date: 2020-11-09.21:40:50

Proposed resolution:

This wording is relative to N4734.

  1. Modify [async.exec.ctx] p1, as indicated:

    // service access
    template<class Service> typename Service::key_type&
    use_service(execution_context& ctx);
    template<class Service, class... Args> Service&
    make_service(execution_context& ctx, Args&&... args);
    template<class Service> bool has_service(const execution_context& ctx) noexcept;
    class service_already_exists : public logic_error { };
    {
    public:
      service_already_exists();
    };
    
  2. Add a new subclause after [async.exec.ctx.globals]:

    13.7.6 Class service_already_exists [async.exec.ctx.except]

    -1- The class service_already_exists defines the type of objects thrown as exceptions to report an attempt to add an existing service to an execution_context.

    service_already_exists();
    

    -2- Postconditions: what() returns an implementation-defined NTBS.

Date: 2020-11-09.00:00:00

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

Date: 2020-04-18.00:00:00

[ 2020-04-18 Issue Prioritization ]

Status set to Tentatively Ready after six positive votes on the reflector.

Date: 2020-03-17.00:00:00

Addresses: networking.ts

In the Networking TS, the service_already_exists exception type has no constructors declared. The logic_error base class is not default constructible, so service_already_exists's implicit default constructor is defined as deleted.

Implementations can add one or more private constructors that can be used by make_service, but there seems to be little benefit to that. The Boost.Asio type of the same name has a public default constructor.

History
Date User Action Args
2023-11-22 15:47:43adminsetstatus: wp -> c++23
2020-11-09 21:40:50adminsetmessages: + msg11565
2020-11-09 21:40:50adminsetstatus: ready -> wp
2020-04-18 12:14:05adminsetmessages: + msg11220
2020-04-18 12:14:05adminsetstatus: new -> ready
2020-03-17 12:58:38adminsetmessages: + msg11166
2020-03-17 00:00:00admincreate