cpp-common/bt2: use universal reference for `Graph::addComponent()` initialization...
authorSimon Marchi <simon.marchi@efficios.com>
Wed, 13 Mar 2024 04:27:54 +0000 (00:27 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Tue, 26 Mar 2024 18:56:36 +0000 (14:56 -0400)
commit1c11db0b68aac8994a92d8c5291eec1ac5ecd82c
tree3ef3a7853654bb8274f07ccdcca64b6ebafaa89a
parent0f63520992da61c0bd6945760e86bc62904d2224
cpp-common/bt2: use universal reference for `Graph::addComponent()` initialization data

I noticed it was not possible to pass data to `Graph::addComponent`
using a temporary object:

    graph->addComponent(*srcCompCls, "source-1", TestSourceData {});

My understanding of it is that the compiler does not consider the
overload with the `InitDataT&` parameter for this, because the temporary
object can't bind to the lvalue reference.

Change these methods to take forwarding references instead.

Change-Id: Icc80239812c325b777ed83e8634302a0c9d72f14
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12049
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Tested-by: jenkins <jenkins@lttng.org>
src/cpp-common/bt2/graph.hpp
This page took 0.025616 seconds and 4 git commands to generate.