mirror of
https://github.com/boostorg/openmethod.git
synced 2026-01-19 04:22:12 +00:00
add method::has_next, and have macros delegate to it
This commit is contained in:
committed by
Jean-Louis Leroy
parent
2f9734b403
commit
efc8cbff52
@@ -1046,6 +1046,9 @@ class method<Name, auto(Parameters...)->ReturnType, Registry>
|
||||
template<auto>
|
||||
static function_type next;
|
||||
|
||||
template<auto>
|
||||
static bool has_next();
|
||||
|
||||
static BOOST_NORETURN auto
|
||||
not_implemented_handler(detail::remove_virtual<Parameters>... 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<auto Fn>
|
||||
inline auto method<Name, auto(Parameters...)->ReturnType, Registry>::has_next()
|
||||
-> bool {
|
||||
return next<Fn> != not_implemented_handler;
|
||||
}
|
||||
|
||||
template<
|
||||
typename Name, typename... Parameters, typename ReturnType, class Registry>
|
||||
BOOST_NORETURN auto method<Name, auto(Parameters...)->ReturnType, Registry>::
|
||||
|
||||
@@ -115,9 +115,8 @@ struct va_args<ReturnType> {
|
||||
}; \
|
||||
inline auto BOOST_OPENMETHOD_OVERRIDERS( \
|
||||
NAME)<__VA_ARGS__ ARGS>::has_next() -> bool { \
|
||||
using method_type = \
|
||||
boost_openmethod_detail_locate_method_aux<void ARGS>::type; \
|
||||
return method_type::next<fn> != method_type::not_implemented_handler; \
|
||||
return boost_openmethod_detail_locate_method_aux< \
|
||||
void ARGS>::type::has_next<fn>(); \
|
||||
} \
|
||||
template<typename... Args> \
|
||||
inline auto BOOST_OPENMETHOD_OVERRIDERS(NAME)<__VA_ARGS__ ARGS>::next( \
|
||||
|
||||
Reference in New Issue
Block a user