diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2020-01-03 01:42:51 +0200 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2020-01-03 16:29:02 +0200 |
commit | 1acad98f7d162ee4e9d5f869489b0c3b17ad80aa (patch) | |
tree | ee5e62a90b4637584140a1e75765c8195422ef13 /utils/rkisp1/rkisp1-capture.sh | |
parent | 7141ac74fd282cfe62de1a61a1f0edaee3c14d8e (diff) |
libcamera: object: Support reference arguments in invokeMethod()
Invoking a method that takes a reference argument with
Object::invokeMethod() results in a compilation error:
../test/object-invoke.cpp:131:11: error: no matching member function for call to 'invokeMethod'
object_.invokeMethod(&InvokedObject::methodWithReference,
~~~~~~~~^~~~~~~~~~~~
../include/libcamera/object.h:33:7: note: candidate template ignored: deduced conflicting types for parameter 'Args' (<const int &> vs. <int>)
void invokeMethod(void (T::*func)(Args...), ConnectionType type, Args... args)
This is due to the fact that implicit type conversions (from value to
reference in this case) takes place after template argument type
deduction, during overload resolution. A similar issue would occur if
T::func took a long argument and invokeMethod() was called with an in
argument.
Fix this by specifying to sets of argument types in the invokeMethod()
template, one for the arguments to the invoked method, and one for the
arguments to invokeMethod() itself. The compiler can then first perform
type deduction separately, and implicit conversion in a second step.
Reported-by: Paul Elder <paul.elder@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Diffstat (limited to 'utils/rkisp1/rkisp1-capture.sh')
0 files changed, 0 insertions, 0 deletions