diff options
author | HampusM <hampus@hampusmat.com> | 2022-04-30 16:28:13 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2022-06-13 17:56:58 +0200 |
commit | 40d02748924aa7c48b04cf948204d8dacdfbbc74 (patch) | |
tree | 4d07a3703207295799b02cef52618a8f0c820542 /src/DI/factory.tpp | |
parent | db6edcd473a684420e9a7611b24462df21165c1b (diff) |
refactor: replace DI files with the yacppdic library
Diffstat (limited to 'src/DI/factory.tpp')
-rw-r--r-- | src/DI/factory.tpp | 65 |
1 files changed, 0 insertions, 65 deletions
diff --git a/src/DI/factory.tpp b/src/DI/factory.tpp deleted file mode 100644 index 38b9c00..0000000 --- a/src/DI/factory.tpp +++ /dev/null @@ -1,65 +0,0 @@ -#pragma once - -#include "factory.hpp" - -template <class Return, class... Args> -Factory<Return(Args...)>::Factory(const Factory &factory) : _functor(factory._functor) -{ -} - -template <class Return, class... Args> -Factory<Return(Args...)>::Factory(Factory &&factory) noexcept - : _functor(std::move(factory._functor)) -{ -} - -template <class Return, class... Args> -auto Factory<Return(Args...)>::operator=(Factory &&factory) noexcept - -> Factory<Return(Args...)> & -{ - _functor = std::move(factory._functor); - return *this; -} - -template <class Return, class... Args> -auto Factory<Return(Args...)>::operator=(std::nullptr_t) noexcept - -> Factory<Return(Args...)> & -{ - _functor = nullptr; - return *this; -} - -template <class Return, class... Args> -Factory<Return(Args...)>::~Factory() = default; - -template <class Return, class... Args> -Factory<Return(Args...)>::operator bool() const noexcept -{ - return static_cast<bool>(_functor); -} - -template <class Return, class... Args> -auto Factory<Return(Args...)>::operator()(Args... args) const -> Return -{ - return _functor(std::forward<Args>(args)...); -} - -template <class Return, class... Args> -auto Factory<Return(Args...)>::target_type() const noexcept -> const std::type_info & -{ - return _functor.target_type(); -} - -template <class Return, class... Args> -template <typename Tp> -auto Factory<Return(Args...)>::target() noexcept -> Tp * -{ - return static_cast<Tp *>(_functor.template target<Tp>()); -} - -template <class Return, class... Args> -template <typename Tp> -auto Factory<Return(Args...)>::target() const noexcept -> const Tp * -{ - return _functor.template target<Tp>(); -} |