ORIGINAL
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
original::callBackChecker Class Reference

Static utility for validating callback signatures. More...

#include <error.h>

Collaboration diagram for original::callBackChecker:
Collaboration graph

Static Public Member Functions

template<typename Callback , typename Ret_TYPE , typename ... Args_TYPE>
static void check ()
 Validates a callback's signature and return type.
 

Detailed Description

Static utility for validating callback signatures.

Provides compile-time and runtime checks for callback function signatures, ensuring they match expected parameter types and return types.

Usage Examples

// Valid callback check
auto valid_cb = [](int x, float y) -> double { return x + y; };
callBackChecker::check<decltype(valid_cb), double, int, float>(); // OK
// Invalid callback check - throws callbackSignatureError
auto invalid_cb = [](int x) { return x; };
callBackChecker::check<decltype(invalid_cb), int, std::string>(); // Throws
// Invalid return type - throws callbackReturnTypeError
auto wrong_return_cb = [](int x) -> float { return x; };
callBackChecker::check<decltype(wrong_return_cb), int, int>(); // Throws
Unique ownership smart pointer with move semantics.
Definition ownerPtr.h:37

Member Function Documentation

◆ check()

template<typename Callback , typename Ret_TYPE , typename... Args_TYPE>
void original::callBackChecker::check ( )
static

Validates a callback's signature and return type.

Template Parameters
CallbackType of the callback to check.
Ret_TYPEExpected return type.
Args_TYPEExpected argument types.
Exceptions
callbackSignatureErrorIf arguments don't match.
callbackReturnTypeErrorIf return type doesn't match.
auto cb = [](int x) { return x + 1.0f; };
callBackChecker::check<decltype(cb), float, int>(); // OK
callBackChecker::check<decltype(cb), int, int>(); // Throws callbackReturnTypeError

The documentation for this class was generated from the following file: