boost::capy::execution_context::use_service
Return a reference to the service of type T, creating it if needed.
Description
If no service of type T exists, one is created by calling T(execution_context&). 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&`.
Exception Safety
Strong guarantee. If service creation throws, the container is unchanged.
Template Parameters
| Name | Description |
|---|---|
T |
The type of service to retrieve or create. |
Created with MrDocs