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>
This commit is contained in:
parent
d08e3b6de1
commit
328cad011e
@ -337,7 +337,7 @@ public:
|
|||||||
{
|
{
|
||||||
for (auto e : *this)
|
for (auto e : *this)
|
||||||
c.emplace_back(e);
|
c.emplace_back(e);
|
||||||
return std::move(c);
|
return std::forward<Container>(c);
|
||||||
}
|
}
|
||||||
template<typename Container = QList<value_type>, if_compatible_container<Container> = true,
|
template<typename Container = QList<value_type>, if_compatible_container<Container> = true,
|
||||||
if_haystack_not_pinned<Container> = true>
|
if_haystack_not_pinned<Container> = true>
|
||||||
@ -345,7 +345,7 @@ public:
|
|||||||
{
|
{
|
||||||
for (auto e : *this)
|
for (auto e : *this)
|
||||||
c.emplace_back(e);
|
c.emplace_back(e);
|
||||||
return std::move(c);
|
return std::forward<Container>(c);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user