diff --git a/include/dpp/cluster.h b/include/dpp/cluster.h index 787b95d854..0b6a980e65 100644 --- a/include/dpp/cluster.h +++ b/include/dpp/cluster.h @@ -493,7 +493,7 @@ class DPP_EXPORT cluster { std::enable_if_t, dpp::task>, bool> register_command(const std::string& name, F&& handler){ std::unique_lock lk(named_commands_mutex); - auto [_, inserted] = named_commands.try_emplace(name, handler); + auto [_, inserted] = named_commands.try_emplace(name, std::forward(handler)); return inserted; }; #endif