Common System 0.2.0
Common interfaces and patterns for system integration
Loading...
Searching...
No Matches
kcenon::common::concepts::InjectableService Concept Reference

A service that can be automatically injected. More...

#include <service.h>

Concept definition

template<typename T>
concept kcenon::common::concepts::InjectableService = std::is_class_v<T> &&
std::is_default_constructible_v<T>
A service that can be automatically injected.
Definition service.h:180

Detailed Description

A service that can be automatically injected.

Injectable services must be default-constructible or have a constructor that accepts container-resolvable dependencies.

Example usage:

template<InjectableService T>
auto create_service() {
return std::make_shared<T>();
}

Definition at line 180 of file service.h.