diff options
author | HampusM <hampus@hampusmat.com> | 2022-04-24 17:13:52 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2022-06-13 17:56:58 +0200 |
commit | db6edcd473a684420e9a7611b24462df21165c1b (patch) | |
tree | 9646bdb4f5f6e339a0a01873b44e0b185476ce56 /src/DI/container.tpp | |
parent | b36d072ad7a7b9c6e30fcb25d6bbb001a8393468 (diff) |
style: improve function and brace styling
Diffstat (limited to 'src/DI/container.tpp')
-rw-r--r-- | src/DI/container.tpp | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/DI/container.tpp b/src/DI/container.tpp index 13397bc..d81a0cc 100644 --- a/src/DI/container.tpp +++ b/src/DI/container.tpp @@ -22,8 +22,10 @@ void BindingBuilder<Interface>::to() noexcept auto wrapper = Container::WrapperPtr<Wrapper>(new Wrapper(*_container)); - _container->add(ObjectType<Interface>(), - std::dynamic_pointer_cast<IGenericWrapper>(wrapper)); + _container->add( + ObjectType<Interface>(), + std::dynamic_pointer_cast<IGenericWrapper>(wrapper) + ); } template <typename Interface> @@ -35,8 +37,10 @@ void BindingBuilder<Interface>::to_factory(FactoryFunc factory) noexcept auto wrapper = Container::WrapperPtr<Wrapper>(new Wrapper(factory)); - _container->add(ObjectType<Interface>(), - std::dynamic_pointer_cast<IGenericWrapper>(wrapper)); + _container->add( + ObjectType<Interface>(), + std::dynamic_pointer_cast<IGenericWrapper>(wrapper) + ); } template <typename Interface> @@ -60,7 +64,8 @@ auto Container::get() const noexcept -> std::unique_ptr<Interface> } auto wrapper = std::dynamic_pointer_cast<IWrapper<std::unique_ptr<Interface>>>( - _bindings.at(interface_type)); + _bindings.at(interface_type) + ); return wrapper->get(); } @@ -69,8 +74,9 @@ template <typename AFactory> requires IsFactory<AFactory> auto Container::get() const noexcept -> AFactory { - auto wrapper = std::dynamic_pointer_cast<IWrapper<AFactory>>( - _bindings.at(ObjectType<AFactory>())); + auto wrapper = + std::dynamic_pointer_cast<IWrapper<AFactory>>(_bindings.at(ObjectType<AFactory>()) + ); return wrapper->get(); } |