diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/yacppdic/factory.hpp | 53 |
1 files changed, 29 insertions, 24 deletions
diff --git a/include/yacppdic/factory.hpp b/include/yacppdic/factory.hpp index 368175a..6de47d8 100644 --- a/include/yacppdic/factory.hpp +++ b/include/yacppdic/factory.hpp @@ -19,29 +19,7 @@ namespace yacppdic template <class> class Factory; -template <class Return> -// NOLINTNEXTLINE(readability-identifier-naming) -struct maybe_derive_from_unary_function -{ -}; - -template <class Return, class Arg> -struct maybe_derive_from_unary_function<Return(Arg)> - : public std::unary_function<Arg, Return> -{ -}; - -template <class Return> -// NOLINTNEXTLINE(readability-identifier-naming) -struct maybe_derive_from_binary_function -{ -}; - -template <class Return, class ArgOne, class ArgTwo> -struct maybe_derive_from_binary_function<Return(ArgOne, ArgTwo)> - : public std::binary_function<ArgOne, ArgTwo, Return> -{ -}; +} template <class Function> auto not_null(Function const & /*unused*/) -> bool @@ -62,11 +40,38 @@ auto not_null(Return Class::*method_ptr) -> bool } template <class Function> -auto not_null(Factory<Function> const &factory) -> bool +auto not_null(yacppdic::Factory<Function> const &factory) -> bool { return !!factory; } +namespace yacppdic +{ + +template <class Return> +// NOLINTNEXTLINE(readability-identifier-naming) +struct maybe_derive_from_unary_function +{ +}; + +template <class Return, class Arg> +struct maybe_derive_from_unary_function<Return(Arg)> + : public std::unary_function<Arg, Return> +{ +}; + +template <class Return> +// NOLINTNEXTLINE(readability-identifier-naming) +struct maybe_derive_from_binary_function +{ +}; + +template <class Return, class ArgOne, class ArgTwo> +struct maybe_derive_from_binary_function<Return(ArgOne, ArgTwo)> + : public std::binary_function<ArgOne, ArgTwo, Return> +{ +}; + template <typename Function, typename Return, typename... Args> concept Callable = !std::is_same_v< |