boost::capy::execution_context::make_service
Construct and add a service.
Synopsis
template<
class T,
class... Args>
T&
make_service(Args&&... args);
Description
A new service of type T is constructed using the provided arguments and added to the container. If T has a nested key_type, the service is also indexed under that type.
Constraints
-
`T` must derive from `service`.
-
`T` must be constructible from `execution_context&, Args...`.
-
If `T::key_type` exists, `T&` must be convertible to `key_type&`.
Exception Safety
Strong guarantee. If service creation throws, the container is unchanged.
Exceptions
Name |
Thrown on |
|
if a service of the same type or |
Parameters
| Name | Description |
|---|---|
args |
Arguments forwarded to the constructor of T. |
Created with MrDocs