Make the service context static

This commit is contained in:
sha512sum 2024-03-29 00:21:04 +00:00
parent 5e441675e5
commit fc20a118c2

View file

@ -332,7 +332,7 @@ struct ServiceContextBuilder {
static constexpr auto Run() -> void {
[]<utempl::ConstexprString... names, typename... TTs, Options... Options>
(utempl::TypeList<ComponentConfig<names, TTs, Options>...>) {
ServiceContext<config, utempl::Tuple{names...}, utempl::Tuple{Options...}, TTs...> context;
static ServiceContext<config, utempl::Tuple{names...}, utempl::Tuple{Options...}, TTs...> context;
context.Run();
for(;;) {
std::this_thread::sleep_for(std::chrono::minutes(1));