Skip to content

Commit eab2aeb

Browse files
authored
Merge pull request #2186 from hzeller/20221103-fix-move-of-temporary-object
Don't std::move a temporary object, as it prevents copy elision.
2 parents 5288a17 + f02de65 commit eab2aeb

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

vpr/src/place/static_move_generator.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
#include "vtr_assert.h"
77

88
StaticMoveGenerator::StaticMoveGenerator(const std::vector<float>& prob) {
9-
avail_moves.push_back(std::move(std::make_unique<UniformMoveGenerator>()));
10-
avail_moves.push_back(std::move(std::make_unique<MedianMoveGenerator>()));
11-
avail_moves.push_back(std::move(std::make_unique<CentroidMoveGenerator>()));
12-
avail_moves.push_back(std::move(std::make_unique<WeightedCentroidMoveGenerator>()));
13-
avail_moves.push_back(std::move(std::make_unique<WeightedMedianMoveGenerator>()));
14-
avail_moves.push_back(std::move(std::make_unique<CriticalUniformMoveGenerator>()));
15-
avail_moves.push_back(std::move(std::make_unique<FeasibleRegionMoveGenerator>()));
9+
avail_moves.emplace_back(std::make_unique<UniformMoveGenerator>());
10+
avail_moves.emplace_back(std::make_unique<MedianMoveGenerator>());
11+
avail_moves.emplace_back(std::make_unique<CentroidMoveGenerator>());
12+
avail_moves.emplace_back(std::make_unique<WeightedCentroidMoveGenerator>());
13+
avail_moves.emplace_back(std::make_unique<WeightedMedianMoveGenerator>());
14+
avail_moves.emplace_back(std::make_unique<CriticalUniformMoveGenerator>());
15+
avail_moves.emplace_back(std::make_unique<FeasibleRegionMoveGenerator>());
1616

1717
initialize_move_prob(prob);
1818
}

0 commit comments

Comments
 (0)