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

Created on 2020-03-17.00:00:00 last changed 2 weeks ago

Messages

Date: 2020-03-23.22:17:17

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-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
2020-03-17 12:58:38adminsetmessages: + msg11166
2020-03-17 00:00:00admincreate