diff options
author | John Fultz <jfultz@wolfram.com> | 2023-07-17 15:49:09 -0500 |
---|---|---|
committer | John Fultz <jfultz@wolfram.com> | 2023-07-17 16:20:01 -0500 |
commit | 3b9e9b6df1d124b29bfd3715b6cb12cdee18b2ea (patch) | |
tree | 9ee43ed8bc403f7f9b444ecb505dbcd5afb11d75 /quackleio | |
parent | 741ba7f9223071da84146069851b48d2344ac03e (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 'quackleio')
-rw-r--r-- | quackleio/dawgfactory.cpp | 1 | ||||
-rw-r--r-- | quackleio/dawgfactory.h | 1 | ||||
-rw-r--r-- | quackleio/flexiblealphabet.cpp | 1 | ||||
-rw-r--r-- | quackleio/gaddagfactory.cpp | 2 | ||||
-rw-r--r-- | quackleio/gaddagfactory.h | 3 |
5 files changed, 8 insertions, 0 deletions
diff --git a/quackleio/dawgfactory.cpp b/quackleio/dawgfactory.cpp index 60c797d..a320f5c 100644 --- a/quackleio/dawgfactory.cpp +++ b/quackleio/dawgfactory.cpp @@ -26,6 +26,7 @@ #include "dawgfactory.h" #include "util.h" +using namespace std; DawgFactory::DawgFactory(const QString &alphabetFile) : m_encodableWords(0), m_unencodableWords(0), m_duplicateWords(0), diff --git a/quackleio/dawgfactory.h b/quackleio/dawgfactory.h index 04e7cb3..0751df3 100644 --- a/quackleio/dawgfactory.h +++ b/quackleio/dawgfactory.h @@ -24,6 +24,7 @@ #include <vector> #include "flexiblealphabet.h" +using std::vector; class DawgFactory { public: diff --git a/quackleio/flexiblealphabet.cpp b/quackleio/flexiblealphabet.cpp index 91d339e..6baf113 100644 --- a/quackleio/flexiblealphabet.cpp +++ b/quackleio/flexiblealphabet.cpp @@ -22,6 +22,7 @@ #include "util.h" using namespace QuackleIO; +using namespace std; FlexibleAlphabetParameters::FlexibleAlphabetParameters() { diff --git a/quackleio/gaddagfactory.cpp b/quackleio/gaddagfactory.cpp index 5d20d38..3fe129d 100644 --- a/quackleio/gaddagfactory.cpp +++ b/quackleio/gaddagfactory.cpp @@ -24,6 +24,8 @@ #include "gaddagfactory.h" #include "util.h" +using namespace std; + GaddagFactory::GaddagFactory(const UVString &alphabetFile) : m_encodableWords(0), m_unencodableWords(0), m_alphas(NULL) { diff --git a/quackleio/gaddagfactory.h b/quackleio/gaddagfactory.h index 364e492..ace0555 100644 --- a/quackleio/gaddagfactory.h +++ b/quackleio/gaddagfactory.h @@ -20,8 +20,11 @@ #define QUACKLE_GADDAGFACTORY_H #include <cstdint> +#include <vector> #include "flexiblealphabet.h" +using std::vector; + // This isn't a strict maximum...you can go higher...but too much higher, and you risk overflowing // node pointers, which will get you garbage words. The OSPS dictionary is known to trigger // such overflows. |