From 93548af514436b24ffaab7ef263f7b35220f0b4e Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Fri, 20 Dec 2019 12:59:19 +0000 Subject: Forward, not move --- libjsonpp/jsonFlexLexer.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libjsonpp/jsonFlexLexer.cpp b/libjsonpp/jsonFlexLexer.cpp index 42aaff8..7c022c5 100644 --- a/libjsonpp/jsonFlexLexer.cpp +++ b/libjsonpp/jsonFlexLexer.cpp @@ -10,7 +10,7 @@ namespace json { { yy_push_state(0); acceptValues.push([&v](auto && value) { - v = std::move(value); + v = std::forward(value); return &v; }); } @@ -29,7 +29,7 @@ namespace json { { auto object = std::get_if(acceptValues.top()(Object())); acceptValues.push([object,this](auto && value) { - return &object->emplace(std::move(name), std::move(value)).first->second; + return &object->emplace(std::move(name), std::forward(value)).first->second; }); } @@ -38,7 +38,7 @@ namespace json { { auto array = std::get_if(acceptValues.top()(Array())); acceptValues.push([array](auto && value) { - return &array->emplace_back(std::move(value)); + return &array->emplace_back(std::forward(value)); }); } -- cgit v1.2.3