diff --git a/include/cserver/engine/components.hpp b/include/cserver/engine/components.hpp index 4be7b99..d6c8170 100644 --- a/include/cserver/engine/components.hpp +++ b/include/cserver/engine/components.hpp @@ -233,29 +233,29 @@ struct DependencyGraph { }; -template +template struct ServiceContextBuilder { - static constexpr auto kList = utempl::kTypeList; + static constexpr auto kList = utempl::kTypeList; static constexpr auto kConfig = config; template - static consteval auto Append(Options = {}) -> decltype(T::template Adder{}>(ServiceContextBuilder{}>>{})) { + static consteval auto Append(Options = {}) -> decltype(T::template Adder{}>(ServiceContextBuilder{}>>{})) { return {}; }; template - static consteval auto Append(Options = {}) -> ServiceContextBuilder{}>> - requires (!requires(ServiceContextBuilder{}>> builder) {T::template Adder{}>(builder);}) { + static consteval auto Append(Options = {}) -> ServiceContextBuilder{}>> + requires (!requires(ServiceContextBuilder{}>> builder) {T::template Adder{}>(builder);}) { return {}; }; template - static consteval auto AppendConfigParam() -> ServiceContextBuilder(Value), Ts...> { + static consteval auto AppendConfigParam() -> ServiceContextBuilder(Value), ComponentConfigs...> { return {}; }; template - static consteval auto TransformComponents(F&& f) -> ServiceContextBuilder { + static consteval auto TransformComponents(F&& f) -> ServiceContextBuilder { return {}; }; template @@ -264,7 +264,7 @@ struct ServiceContextBuilder { (const ServiceContextBuilder...>&) -> decltype(utempl::Get>(utempl::TypeList...>{})>(utempl::TypeList{})) { std::unreachable(); - }(ServiceContextBuilder{}); + }(ServiceContextBuilder{}); }; static consteval auto Config() { @@ -272,16 +272,16 @@ struct ServiceContextBuilder { }; static consteval auto GetDependencyGraph() { - return [&] - (ComponentConfig...){ - return DependencyGraph - (ComponentConfig) { - impl::DependencyInfoInjector injector; + return [&] + (ComponentConfig...){ + return DependencyGraph + (ComponentConfig) { + impl::DependencyInfoInjector injector; injector.template Inject(); return injector.GetDependencies(); - }(Ts{})>...>{}; - }(Ts{}...); + }(ComponentConfigs{})>...>{}; + }(ComponentConfigs{}...); }; @@ -293,7 +293,7 @@ struct ServiceContextBuilder { for(;;) { std::this_thread::sleep_for(std::chrono::minutes(1)); }; - }(utempl::TypeList{}); + }(utempl::TypeList{}); }; }; } // namespace cserver