cpp: Do not use namespace using-directives

Use using-declarations instead.  [build/namespaces]
This commit is contained in:
Calcitem 2021-11-14 01:27:27 +08:00
parent cdcf29e46a
commit aa1852b2cc
No known key found for this signature in database
GPG Key ID: F67E4F8CB7B5EED2
7 changed files with 26 additions and 11 deletions

View File

@ -17,6 +17,8 @@
#include <string>
#include "endgame.h"
using std::string;
#ifdef ENDGAME_LEARNING
static constexpr int endgameHashSize = 0x1000000; // 16M
HashMap<Key, Endgame> endgameHashMap(endgameHashSize);

View File

@ -21,13 +21,10 @@
#ifdef ENDGAME_LEARNING
#include <vector>
#include "hashmap.h"
#include "types.h"
using namespace std;
using namespace CTSL;
using CTSL::HashMap;
static const int SAVE_ENDGAME_EVERY_N_GAMES = 256;

View File

@ -57,7 +57,17 @@ typedef bool (*fun3_t)(HANDLE, CONST GROUP_AFFINITY*, PGROUP_AFFINITY);
#include "misc.h"
#include "thread.h"
using namespace std;
using std::cerr;
using std::cin;
using std::cout;
using std::endl;
using std::ifstream;
using std::iostream;
using std::ofstream;
using std::setfill;
using std::setw;
using std::streambuf;
using std::stringstream;
namespace {
@ -524,7 +534,7 @@ void bindThisThread(size_t)
/// best_group() retrieves logical processor information using Windows specific
/// API and returns the best group id for the thread with index idx. Original
/// code from Texel by Peter Ãsterlund.
/// code from Texel by Peter A-terlund.
int best_group(size_t idx)
{

View File

@ -25,7 +25,7 @@
#include "stopwatch.h"
#endif
using namespace std;
using std::vector;
namespace Search {

View File

@ -30,18 +30,22 @@
#include "engine_main.h"
#endif
ThreadPool Threads; // Global object
#ifdef OPENING_BOOK
#include <deque>
using namespace std;
#endif
using std::cout;
using std::endl;
using std::fixed;
using std::setprecision;
#if _MSC_VER >= 1600
#pragma warning(disable : 4695)
#pragma execution_character_set("ANSI")
#endif
ThreadPool Threads; // Global object
/// Thread constructor launches the thread and waits until it goes to sleep
/// in idle_loop(). Note that 'searching' and 'exit' should be already set.

View File

@ -34,6 +34,8 @@
#include <QObject>
#endif // QT_GUI_LIB
using std::string;
/// Thread class keeps together all the thread-related stuff. We use
/// per-thread pawn and material hash tables so that once we get a
/// pointer to an entry its life time is unlimited and we don't have

View File

@ -20,7 +20,7 @@
#include "hashmap.h"
#include "types.h"
using namespace CTSL;
using CTSL::HashMap;
#ifdef TRANSPOSITION_TABLE_ENABLE