From 04902f8209f53ce644a97c27570b545219749b41 Mon Sep 17 00:00:00 2001 From: Jason Turner Date: Fri, 25 Aug 2017 12:48:34 -0600 Subject: [PATCH] Use C++17's emplace_back return reference --- include/chaiscript/dispatchkit/dispatchkit.hpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/chaiscript/dispatchkit/dispatchkit.hpp b/include/chaiscript/dispatchkit/dispatchkit.hpp index f51aa0cf..6ff2accb 100644 --- a/include/chaiscript/dispatchkit/dispatchkit.hpp +++ b/include/chaiscript/dispatchkit/dispatchkit.hpp @@ -516,8 +516,7 @@ namespace chaiscript throw chaiscript::exception::name_conflict_error(t_name); } - stack_elem.emplace_back(t_name, std::move(obj)); - return stack_elem.back().second; + return stack_elem.emplace_back(t_name, std::move(obj)).second; }