From c78319b1060166e19afa3693f56a2623eff21dd5 Mon Sep 17 00:00:00 2001 From: Michal Jarzabek Date: Thu, 19 May 2016 19:33:50 +0100 Subject: [PATCH] osd/ReplicatedPG.h: remove incorrect use of move The modified functions take universal references, so they can bind to either rvalues and lvalues. When they bind to lvalues the use of std::move is incorrect. We should use std::forward, so we only move from rvalues. Signed-off-by: Michal Jarzabek --- src/osd/ReplicatedPG.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/osd/ReplicatedPG.h b/src/osd/ReplicatedPG.h index fc5e5d46673..d561f891c8d 100644 --- a/src/osd/ReplicatedPG.h +++ b/src/osd/ReplicatedPG.h @@ -563,19 +563,19 @@ public: list> on_success; template void register_on_finish(F &&f) { - on_finish.emplace_back(std::move(f)); + on_finish.emplace_back(std::forward(f)); } template void register_on_success(F &&f) { - on_success.emplace_back(std::move(f)); + on_success.emplace_back(std::forward(f)); } template void register_on_applied(F &&f) { - on_applied.emplace_back(std::move(f)); + on_applied.emplace_back(std::forward(f)); } template void register_on_commit(F &&f) { - on_committed.emplace_back(std::move(f)); + on_committed.emplace_back(std::forward(f)); } bool sent_ack;