diff --git a/include/boost/openmethod/core.hpp b/include/boost/openmethod/core.hpp index f6bbbb6..d364b11 100644 --- a/include/boost/openmethod/core.hpp +++ b/include/boost/openmethod/core.hpp @@ -1046,6 +1046,9 @@ class methodReturnType, Registry> template static function_type next; + template + static bool has_next(); + static BOOST_NORETURN auto not_implemented_handler(detail::remove_virtual... args) -> ReturnType; @@ -1354,6 +1357,14 @@ auto error_type_id(const Class& obj) { } // namespace detail +template< + typename Name, typename... Parameters, typename ReturnType, class Registry> +template +inline auto methodReturnType, Registry>::has_next() + -> bool { + return next != not_implemented_handler; +} + template< typename Name, typename... Parameters, typename ReturnType, class Registry> BOOST_NORETURN auto methodReturnType, Registry>:: diff --git a/include/boost/openmethod/macros.hpp b/include/boost/openmethod/macros.hpp index 316f21c..26ad774 100644 --- a/include/boost/openmethod/macros.hpp +++ b/include/boost/openmethod/macros.hpp @@ -115,9 +115,8 @@ struct va_args { }; \ inline auto BOOST_OPENMETHOD_OVERRIDERS( \ NAME)<__VA_ARGS__ ARGS>::has_next() -> bool { \ - using method_type = \ - boost_openmethod_detail_locate_method_aux::type; \ - return method_type::next != method_type::not_implemented_handler; \ + return boost_openmethod_detail_locate_method_aux< \ + void ARGS>::type::has_next(); \ } \ template \ inline auto BOOST_OPENMETHOD_OVERRIDERS(NAME)<__VA_ARGS__ ARGS>::next( \