template<class... T>
struct ugmisc::call_foo_method< T >
This is an example of the type of template that is created by the UGMISC_NAMED_MEMBER_STATIC_METHOD_CALL and UGMISC_MEMBER_STATIC_METHOD_CALL macros.
In this example the NAME parameter of the macro is foo.
template<class... T>
template<class F>
Provides a fallback default value getter. This is a callable rather than the default value, so that default values which have a runtime overhead to create and destroy can be avoided where they are not needed.
The callable may accept the forwarded arguments that were supposed to be passed to a static foo() method of one of the T type parameters, or it may accept no arguments. For example:
static constexpr auto fallback(F &&functor)
This will make the first valid call and return the results:
- X::foo(args...)
- Y::foo(args...)
- Z::foo(args...)
- default_foo(args...)
- default_foo()
- Returns
- An object which is callable just like an instance of call_foo_method is callable, but will fall back to calling the provided function or functor if the type parameters don't support the method call.
- Parameters
-
| functor | Creates a default return value if needed. |