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.

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: