mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-12 14:59:44 +03:00
libcamera: base: object: Forward arguments when invoking
Use `std::forward()` to forward the received arguments to enable the
potential use of move constructors instead of copy constructors.
Commit 0eacde623b
("libcamera: object: Avoid argument copies in invokeMethod()")
added the forwarding references to `invokeMethod()` but it did not add the
appropriate `std::forward()` calls, so copying could still take place
even if not necessary.
Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
parent
37283b68ea
commit
7dd548f678
1 changed files with 2 additions and 1 deletions
|
@ -9,6 +9,7 @@
|
|||
|
||||
#include <list>
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include <libcamera/base/bound_method.h>
|
||||
|
@ -39,7 +40,7 @@ public:
|
|||
{
|
||||
T *obj = static_cast<T *>(this);
|
||||
auto *method = new BoundMethodMember<T, R, FuncArgs...>(obj, this, func, type);
|
||||
return method->activate(args..., true);
|
||||
return method->activate(std::forward<Args>(args)..., true);
|
||||
}
|
||||
|
||||
Thread *thread() const { return thread_; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue