]> git.sesse.net Git - stockfish/commit - src/evaluate.cpp
Avoid "using namespace std"
authorSebastian Buchwald <UniQP@web.de>
Mon, 4 Sep 2023 20:01:20 +0000 (22:01 +0200)
committerDisservin <disservin.social@gmail.com>
Mon, 11 Sep 2023 20:07:55 +0000 (22:07 +0200)
commita8b4fd16716e74a9819e798fc09e5926e003013e
tree470b8a67e9567ed9bb6d2d9543941321c1661074
parentb25d68f6ee2d016cc0c14b076e79e6c44fdaea2a
Avoid "using namespace std"

This is a cleanup PR that prepares the automatic checking of missing or
superfluous #include directives via the include-what-you-use (IWYU) tool
on the CI. Unfortunately, IWYU proposes additional includes for
"namespace std" although we don't need them.

To avoid the problem, the commit removes all "using namespace std"
statements from the code and directly uses the std:: prefix instead.
Alternatively, we could add specific usings (e.g. "using std::string")
foreach used type. Also, a mix of both approaches would be possible.
I decided for the prefix approach because most of the files were already
using the std:: prefixes despite the "using namespace std".

closes https://github.com/official-stockfish/Stockfish/pull/4772

No functional change
src/benchmark.cpp
src/evaluate.cpp
src/misc.cpp
src/uci.cpp