ORIGINAL
Loading...
Searching...
No Matches
original::CallbackOf Concept Reference

Validates callback signature compatibility. More...

#include <types.h>

Concept definition

template<typename Callback, typename ReturnType, typename... Args>
concept original::CallbackOf = requires(Callback callback, Args&&... args) {
{ callback(std::forward<Args>(args)...) } -> std::convertible_to<ReturnType>;
}
Validates callback signature compatibility.
Definition types.h:345

Detailed Description

Validates callback signature compatibility.

Template Parameters
CallbackCallable type to check
ReturnTypeExpected return type
ArgsExpected 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>); // Succeeds
static_assert(CallbackOf<decltype(lambda), double, int>); // Fails (return type mismatch)
Unique ownership smart pointer with move semantics.
Definition ownerPtr.h:37