From 561db36b8abb5ad1db7f5dbd827d4cd1794b0860 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 24 Apr 2024 09:30:41 +0200 Subject: Don't do `using namespace` before including headers in odb-tests/libcommon --- odb-tests/libcommon/common.cxx | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/odb-tests/libcommon/common.cxx b/odb-tests/libcommon/common.cxx index b3e4cfd..4b4603d 100644 --- a/odb-tests/libcommon/common.cxx +++ b/odb-tests/libcommon/common.cxx @@ -10,10 +10,6 @@ #include #include -using namespace std; -using namespace odb::core; - - // MySQL. // #if defined(DATABASE_MYSQL) @@ -21,9 +17,11 @@ using namespace odb::core; #include #include -static unique_ptr +static std::unique_ptr create_mysql_database (int& argc, char* argv[], bool, size_t max_connections) { + using namespace std; + using namespace odb::core; namespace mysql = odb::mysql; unique_ptr f; @@ -47,12 +45,14 @@ create_mysql_database (int& argc, char* argv[], bool, size_t max_connections) #include #include -static unique_ptr +static std::unique_ptr create_sqlite_database (int& argc, char* argv[], bool schema, size_t max_connections) { + using namespace std; + using namespace odb::core; namespace sqlite = odb::sqlite; unique_ptr f; @@ -102,9 +102,11 @@ create_sqlite_database (int& argc, #include #include -static unique_ptr +static std::unique_ptr create_pgsql_database (int& argc, char* argv[], bool, size_t max_connections) { + using namespace std; + using namespace odb::core; namespace pgsql = odb::pgsql; unique_ptr f; @@ -125,9 +127,11 @@ create_pgsql_database (int& argc, char* argv[], bool, size_t max_connections) #include #include -static unique_ptr +static std::unique_ptr create_oracle_database (int& argc, char* argv[], bool, size_t max_connections) { + using namespace std; + using namespace odb::core; namespace oracle = odb::oracle; unique_ptr f; @@ -150,9 +154,11 @@ create_oracle_database (int& argc, char* argv[], bool, size_t max_connections) #include #include -static unique_ptr +static std::unique_ptr create_mssql_database (int& argc, char* argv[], bool, size_t max_connections) { + using namespace std; + using namespace odb::core; namespace mssql = odb::mssql; unique_ptr f; @@ -168,7 +174,7 @@ create_mssql_database (int& argc, char* argv[], bool, size_t max_connections) // // -unique_ptr +std::unique_ptr create_database (int argc, char* argv[], bool schema, @@ -180,6 +186,9 @@ create_database (int argc, #endif ) { + using namespace std; + using namespace odb::core; + char** argp = argv + 1; // Position of the next argument. Assignment for VC8. int argn (argc - 1); // Number of arguments left. -- cgit v1.1