I'm interested in defining a function using a predefined callback type.
Let's assume I have defined callback type:
typedef BOOL (*is_trigger_required_cb)(void);
Now I would like to declare and define a function using the above type.
I would like to do something like:
is_trigger_required_cb my_func { /* function implementation which accepts void and returns BOOL */ }
This won't compile due to:
error: expected ';' after top level declarator
To my understanding it is not possible since the compiler refers to the callback type merely as type-safe function pointer and cannot be used for function definition. In case there's a change of callback type, it would break the compilation thus type safety is maintained.