Validates callback signature compatibility.
More...
#include <types.h>
template<typename Callback, typename ReturnType, typename... Args>
{ callback(std::forward<Args>(args)...) } -> std::convertible_to<ReturnType>;
}
Validates callback signature compatibility.
Definition types.h:266
Validates callback signature compatibility.
- Template Parameters
-
| Callback | Callable type to check |
| ReturnType | Expected return type |
| Args | Expected argument types |
Ensures the callback can be invoked with specified arguments and returns the specified type. Supports perfect forwarding of arguments.
auto lambda = [](int x) { return x * 2; };
static_assert(
CallbackOf<
decltype(lambda),
int,
int>);
static_assert(
CallbackOf<
decltype(lambda),
double,
int>);