diff options
author | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2020-11-10 22:05:17 +0100 |
---|---|---|
committer | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2020-11-12 06:02:49 +0100 |
commit | 328cad011e48a033d235c323fbe575c92c228027 (patch) | |
tree | 1c57d5a7c8ea395311564e18dd10f3f9dee9b893 | |
parent | d08e3b6de16118becaada17a58aed4042f400a5a (diff) |
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 <volker.hilsheimer@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
-rw-r--r-- | src/corelib/text/qstringtokenizer.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/text/qstringtokenizer.h b/src/corelib/text/qstringtokenizer.h index f1da701af2..76d8015159 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<Container>(c); } template<typename Container = QList<value_type>, if_compatible_container<Container> = true, if_haystack_not_pinned<Container> = true> @@ -345,7 +345,7 @@ public: { for (auto e : *this) c.emplace_back(e); - return std::move(c); + return std::forward<Container>(c); } #endif }; |