From 328cad011e48a033d235c323fbe575c92c228027 Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Tue, 10 Nov 2020 22:05:17 +0100 Subject: [PATCH] QStringTokenizer: fix a misuse of std::move `Container` is a forwarding reference, so use std::forward. The deduction for l-values wouldn't make this code even compile with std::move. Change-Id: Icc9b81a8ad1c76ef1e2ef0f08e7a86b0b4c4ce59 Reviewed-by: Volker Hilsheimer Reviewed-by: Lars Knoll --- src/corelib/text/qstringtokenizer.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/corelib/text/qstringtokenizer.h b/src/corelib/text/qstringtokenizer.h index f1da701af27..76d8015159f 100644 --- a/src/corelib/text/qstringtokenizer.h +++ b/src/corelib/text/qstringtokenizer.h @@ -337,7 +337,7 @@ public: { for (auto e : *this) c.emplace_back(e); - return std::move(c); + return std::forward(c); } template, if_compatible_container = true, if_haystack_not_pinned = true> @@ -345,7 +345,7 @@ public: { for (auto e : *this) c.emplace_back(e); - return std::move(c); + return std::forward(c); } #endif };