App: Don't use std::forward inside loop
std::forward implies that sometimes its argument will be *moved*, leaving it invalid in the calling code. If that call is inside a loop that tries to reuse the data we have undefined behavior.
This commit is contained in:
committed by
Benjamin Nauck
parent
4ceecd0857
commit
c252f40b6f
@@ -1955,7 +1955,7 @@ std::vector<std::string> updateLinkSubs(const App::DocumentObject* obj,
|
||||
std::vector<std::string> res;
|
||||
for (auto it = subs.begin(); it != subs.end(); ++it) {
|
||||
const auto& sub = *it;
|
||||
auto new_sub = (*f)(obj, sub.c_str(), std::forward<Args>(args)...);
|
||||
auto new_sub = (*f)(obj, sub.c_str(), args...);
|
||||
if (new_sub.size()) {
|
||||
if (res.empty()) {
|
||||
res.reserve(subs.size());
|
||||
|
||||
Reference in New Issue
Block a user