diff options
Diffstat (limited to 'src/DI/container.hpp')
-rw-r--r-- | src/DI/container.hpp | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/src/DI/container.hpp b/src/DI/container.hpp index 6cb89ce..2dd194f 100644 --- a/src/DI/container.hpp +++ b/src/DI/container.hpp @@ -1,9 +1,9 @@ #pragma once +#include "DI/interfaces/wrapper.hpp" #include "DI/object_type.hpp" -#include "interfaces/wrapper.hpp" +#include "DI/type_traits.hpp" -#include <functional> #include <memory> #include <type_traits> #include <unordered_map> @@ -26,16 +26,6 @@ private: Container *_container; }; -template <typename Satan> -struct is_func : public std::false_type // NOLINT(readability-identifier-naming) -{ -}; - -template <typename Satan, typename... Args> -struct is_func<std::function<Satan(Args...)>> : public std::true_type -{ -}; - class Container { public: @@ -47,7 +37,7 @@ public: template <class Interface, class = std::enable_if_t<std::is_abstract_v<Interface>>> std::shared_ptr<Interface> get() const; - template <typename Interface, typename = std::enable_if_t<is_func<Interface>::value>> + template <typename Interface, typename = std::enable_if_t<is_func_v<Interface>>> Interface get() const; std::unordered_map<BaseObjectType, std::shared_ptr<IGenericWrapper>, ObjectTypeHasher> |