diff options
author | HampusM <hampus@hampusmat.com> | 2022-04-29 20:48:51 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2022-04-29 20:48:51 +0200 |
commit | 46b371e7c5298cfe36a59ac5108a718b6214decc (patch) | |
tree | 4b734e17fcf17b4f3fa76e14077abfd4f604ffd2 /include | |
parent | b8b238c314f77ccf5db1c385b9f526ccc30aed23 (diff) |
fix: move not null_null position in factory header
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< |