diff --git a/backend/genesys/image_pipeline.h b/backend/genesys/image_pipeline.h index f85c17574..4a1bdc7af 100644 --- a/backend/genesys/image_pipeline.h +++ b/backend/genesys/image_pipeline.h @@ -585,19 +585,31 @@ public: template void push_first_node(Args&&... args) + { + push_first_node(std::unique_ptr(new Node(std::forward(args)...))); + } + + template + void push_first_node(std::unique_ptr&& node) { if (!nodes_.empty()) { throw SaneException("Trying to append first node when there are existing nodes"); } - nodes_.emplace_back(std::unique_ptr(new Node(std::forward(args)...))); + nodes_.emplace_back(std::move(node)); } template void push_node(Args&&... args) { ensure_node_exists(); - nodes_.emplace_back(std::unique_ptr(new Node(*nodes_.back(), - std::forward(args)...))); + push_node(std::unique_ptr(new Node(*nodes_.back(), std::forward(args)...))); + } + + template + void push_node(std::unique_ptr&& node) + { + ensure_node_exists(); + nodes_.emplace_back(std::move(node)); } bool get_next_row_data(std::uint8_t* out_data)