summaryrefslogtreecommitdiff
path: root/datamanager.h
diff options
context:
space:
mode:
authorJohn Fultz <jfultz@wolfram.com>2023-07-17 15:49:09 -0500
committerJohn Fultz <jfultz@wolfram.com>2023-07-17 16:20:01 -0500
commit3b9e9b6df1d124b29bfd3715b6cb12cdee18b2ea (patch)
tree9ee43ed8bc403f7f9b444ecb505dbcd5afb11d75 /datamanager.h
parent741ba7f9223071da84146069851b48d2344ac03e (diff)
Fix up std:: namespace hygiene.
* Remove all uses of `using namespace std` from header files (although a few specific cases of things like `using std::vector` remain) * Move all existing uses of `using namespace std` in cpp files to after the header includes * Make coordinating changes so it builds again. Qt6 builds on Windows were breaking because of namespace collision between std::byte and some version of `byte` in one of Qt's namespaces. That breakage is now fixed. It would be good to systematically clean up all `using` declarations in header files to ensure nothing is leaking out, but that's for another time.
Diffstat (limited to 'datamanager.h')
-rw-r--r--datamanager.h10
1 files changed, 4 insertions, 6 deletions
diff --git a/datamanager.h b/datamanager.h
index ca6ddd3..aa1bb3b 100644
--- a/datamanager.h
+++ b/datamanager.h
@@ -26,8 +26,6 @@
#include "playerlist.h"
-using namespace std;
-
#define QUACKLE_DATAMANAGER Quackle::DataManager::self()
#define QUACKLE_DATAMANAGER_EXISTS Quackle::DataManager::exists()
#define QUACKLE_EVALUATOR Quackle::DataManager::self()->evaluator()
@@ -125,11 +123,11 @@ public:
string userDataDirectory() { return m_userDataDirectory; }
void seedRandomNumbers(unsigned int seed);
- void seedRandomNumbers(seed_seq& seed);
+ void seedRandomNumbers(std::seed_seq& seed);
int randomInteger(int low, int high);
template <typename T> void shuffle(T& collection)
{
- lock_guard<mutex> lock(m_RngMutex);
+ std::lock_guard<std::mutex> lock(m_RngMutex);
std::shuffle(collection.begin(), collection.end(), m_mersenneTwisterRng);
}
@@ -154,8 +152,8 @@ private:
PlayerList m_computerPlayers;
- mt19937_64 m_mersenneTwisterRng;
- mutex m_RngMutex;
+ std::mt19937_64 m_mersenneTwisterRng;
+ std::mutex m_RngMutex;
};
inline DataManager *DataManager::self()