From f307a84240e62cc70d59ba36fe744a3a17e13079 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Poyraz=20K=C3=BC=C3=A7=C3=BCkarslan?= <83272398+PoyrazK@users.noreply.github.com> Date: Thu, 5 Mar 2026 21:07:54 +0300 Subject: [PATCH] fix: qualify std::move calls in headers Explicitly qualifies all calls to `move()` with the `std::` prefix in `include/Planet.hpp` and `include/SolarSystem.hpp`. This resolves compiler warnings regarding unqualified calls to `std::move` (e.g., -Wunqualified-std-cast-call) and ensures compliance with standard library best practices, especially when `using namespace std;` is present. --- include/Planet.hpp | 14 +++++++------- include/SolarSystem.hpp | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/Planet.hpp b/include/Planet.hpp index 7d62504..3e2e109 100644 --- a/include/Planet.hpp +++ b/include/Planet.hpp @@ -296,17 +296,17 @@ template class StackPlanet : public BasePlanet { // 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(s.size()); } }; @@ -390,12 +390,12 @@ template class QueuePlanet : public BasePlanet { // 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(q.size()); } }; diff --git a/include/SolarSystem.hpp b/include/SolarSystem.hpp index fdcd09a..1a915da 100644 --- a/include/SolarSystem.hpp +++ b/include/SolarSystem.hpp @@ -164,7 +164,7 @@ template 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; }