summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2019-12-20 12:59:19 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2019-12-20 12:59:19 +0000
commit93548af514436b24ffaab7ef263f7b35220f0b4e (patch)
tree2ce27aecf829eb20b6e8402e63e011ba86c785b6
parentEncoding should be const (diff)
downloadlibjsonpp-93548af514436b24ffaab7ef263f7b35220f0b4e.tar.bz2
libjsonpp-93548af514436b24ffaab7ef263f7b35220f0b4e.tar.xz
libjsonpp-93548af514436b24ffaab7ef263f7b35220f0b4e.zip
Forward, not move
-rw-r--r--libjsonpp/jsonFlexLexer.cpp6
1 files 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>(value);
return &v;
});
}
@@ -29,7 +29,7 @@ namespace json {
{
auto object = std::get_if<Object>(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>(value)).first->second;
});
}
@@ -38,7 +38,7 @@ namespace json {
{
auto array = std::get_if<Array>(acceptValues.top()(Array()));
acceptValues.push([array](auto && value) {
- return &array->emplace_back(std::move(value));
+ return &array->emplace_back(std::forward<Value>(value));
});
}