Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions include/Planet.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -296,17 +296,17 @@ template <typename T> class StackPlanet : public BasePlanet<T> {

// Reverse into temp to preserve original insertion order
while (!s.empty()) {
temp.push(move(s.top()));
temp.push(std::move(s.top()));
s.pop();
}
// Filter: keep only elements >= threshold
while (!temp.empty()) {
T value = move(temp.top());
T value = std::move(temp.top());
temp.pop();
if (value >= threshold)
survivors.push(move(value));
survivors.push(std::move(value));
}
s = move(survivors);
s = std::move(survivors);
removedCount += beforeSize - static_cast<int>(s.size());
}
};
Expand Down Expand Up @@ -390,12 +390,12 @@ template <typename T> class QueuePlanet : public BasePlanet<T> {

// Drain queue, keeping only elements >= threshold
while (!q.empty()) {
T value = move(q.front());
T value = std::move(q.front());
q.pop();
if (value >= threshold)
survivors.push(move(value));
survivors.push(std::move(value));
}
q = move(survivors);
q = std::move(survivors);
removedCount += beforeSize - static_cast<int>(q.size());
}
};
Expand Down
2 changes: 1 addition & 1 deletion include/SolarSystem.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ template <typename T> class SolarSystem {

cout << "Planet Id: " << p->metadata << " (" << p->name << ")" << endl;

planets.push_back(move(p)); // Move semantics: transfers ownership
planets.push_back(std::move(p)); // Move semantics: transfers ownership
star.planet_count++;
star.id = star.planet_count - 1;
}
Expand Down