In reviewing the pr, don't think there are problems with introducing the callable interface. This design is compatible with passing function objects by both reference and by value, and adds convenient integration with existing C and C++ callback APIs without creating a special case for mbed OS.
There is a concern that this interface would encourage users to use the unclear event() syntax. But this can be discouraged through documentation.
Given the experimental nature of this repository, I'm going to go ahead and merge this pr. We can deprecate the callback operations at a later version if we find them to be impractical.
This adds a C++ style function API that allows the event class to be easily passed as an argument to existing callback based APIs:
The previous discussion on this subject can be found here: https://github.com/ARMmbed/mbed-events/pull/15
In reviewing the pr, don't think there are problems with introducing the callable interface. This design is compatible with passing function objects by both reference and by value, and adds convenient integration with existing C and C++ callback APIs without creating a special case for mbed OS.
There is a concern that this interface would encourage users to use the unclear
event()
syntax. But this can be discouraged through documentation.cc @pan-