Skip to content

refactor: remove using namespace std from headers and source#3

Open
poyrazK wants to merge 1 commit intomamitrkr:mainfrom
poyrazK:refactor/remove-using-std
Open

refactor: remove using namespace std from headers and source#3
poyrazK wants to merge 1 commit intomamitrkr:mainfrom
poyrazK:refactor/remove-using-std

Conversation

@poyrazK
Copy link
Copy Markdown

@poyrazK poyrazK commented Mar 5, 2026

Removes the using namespace std; directive from all header and source files to prevent global namespace pollution.

Changes:

  • Removed using namespace std; from include/Planet.hpp.
  • Explicitly qualified STL types in include/Planet.hpp, include/SolarSystem.hpp, src/main.cpp, and tests/unit_tests.cpp.
  • Fixed compilation errors in main.cpp and unit_tests.cpp resulting from the removal.

This is a senior-level refactoring to improve code hygiene and prevent naming collisions.

Removes the `using namespace std;` directive from all header and source files to prevent global namespace pollution. All standard library types, objects, and functions (e.g., `std::vector`, `std::string`, `std::cout`, `std::endl`, `std::out_of_range`) are now explicitly qualified with the `std::` prefix. This aligns the codebase with C++ best practices for better maintainability and naming collision prevention.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant