diff options
Diffstat (limited to 'src/DI/type_traits.hpp')
-rw-r--r-- | src/DI/type_traits.hpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/DI/type_traits.hpp b/src/DI/type_traits.hpp new file mode 100644 index 0000000..a852a4f --- /dev/null +++ b/src/DI/type_traits.hpp @@ -0,0 +1,16 @@ +#pragma once + +#include <functional> + +template <typename NotAFunc> +struct is_func : public std::false_type // NOLINT(readability-identifier-naming) +{ +}; + +template <typename Return, typename... Args> +struct is_func<std::function<Return(Args...)>> : public std::true_type +{ +}; + +template <typename PossiblyFunc> +inline constexpr bool is_func_v = is_func<PossiblyFunc>::value; |