From 621edb2367e81860f6b6e89243ad7cbe3e0b6b7f Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Fri, 3 Jan 2020 20:56:05 +0200 Subject: libcamera: bound_method: Support bindings to non-void methods MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The bound method implementation is restricted to binding to void methods as return values are not supported. This complicates usage of bound methods, as non-void methods used a slots or Object::invokeMethod() targets need to be wrapped in a void method. Simplify this by supporting arbitrary return types and ignoring the return value. Signed-off-by: Laurent Pinchart Reviewed-by: Niklas Söderlund --- src/libcamera/signal.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/libcamera') diff --git a/src/libcamera/signal.cpp b/src/libcamera/signal.cpp index 6ee348ac..19003331 100644 --- a/src/libcamera/signal.cpp +++ b/src/libcamera/signal.cpp @@ -54,7 +54,7 @@ namespace libcamera { */ /** - * \fn Signal::connect(T *object, void(T::*func)(Args...)) + * \fn Signal::connect(T *object, R (T::*func)(Args...)) * \brief Connect the signal to a member function slot * \param[in] object The slot object pointer * \param[in] func The slot member function @@ -66,7 +66,7 @@ namespace libcamera { */ /** - * \fn Signal::connect(void(*func)(Args...)) + * \fn Signal::connect(R (*func)(Args...)) * \brief Connect the signal to a static function slot * \param[in] func The slot static function */ @@ -83,14 +83,14 @@ namespace libcamera { */ /** - * \fn Signal::disconnect(T *object, void(T::*func)(Args...)) + * \fn Signal::disconnect(T *object, R (T::*func)(Args...)) * \brief Disconnect the signal from the \a object slot member function \a func * \param[in] object The object pointer whose slots to disconnect * \param[in] func The slot member function to disconnect */ /** - * \fn Signal::disconnect(void(*func)(Args...)) + * \fn Signal::disconnect(R (*func)(Args...)) * \brief Disconnect the signal from the slot static function \a func * \param[in] func The slot static function to disconnect */ -- cgit v1.2.1