diff options
author | HampusM <hampus@hampusmat.com> | 2022-04-10 17:20:49 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2022-06-13 17:56:58 +0200 |
commit | b36d072ad7a7b9c6e30fcb25d6bbb001a8393468 (patch) | |
tree | 7749fc877652bb2cf7bbd2b7c1fed5e3abe397fc /src/DI/type_traits.hpp | |
parent | b828d4799a84beb1afbd889e5c4cb939a8b3df78 (diff) |
refactor: add factory class & make DI container return unique ptrs
Diffstat (limited to 'src/DI/type_traits.hpp')
-rw-r--r-- | src/DI/type_traits.hpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/DI/type_traits.hpp b/src/DI/type_traits.hpp index e4b6640..6847c4f 100644 --- a/src/DI/type_traits.hpp +++ b/src/DI/type_traits.hpp @@ -1,16 +1,18 @@ #pragma once +#include "DI/factory.hpp" + #include <type_traits> -template <typename NotAFunc> -struct is_func : public std::false_type // NOLINT(readability-identifier-naming) +template <typename NotAFunction> +struct is_factory : public std::false_type // NOLINT(readability-identifier-naming) { }; template <typename Return, typename... Args> -struct is_func<Return (*)(Args...)> : public std::true_type +struct is_factory<Factory<Return(Args...)>> : public std::true_type { }; -template <typename PossiblyFunc> -inline constexpr bool is_func_v = is_func<PossiblyFunc>::value; +template <typename PossiblyFunction> +inline constexpr bool is_factory_v = is_factory<PossiblyFunction>::value; |