boost::corosio::basic_io_context::use_service
Return a reference to the service of type T, creating it if needed.
Synopsis
Declared in <boost/capy/ex/execution_context.hpp>
template<class T>
T&
use_service();
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