From 0db05a886a4d61be693738aaaf9d5b7797f9fb92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= <sebastien@dynare.org> Date: Thu, 6 Jan 2022 14:54:57 +0100 Subject: [PATCH] =?UTF-8?q?Move=20=E2=80=9Cusing=20namespace=20std?= =?UTF-8?q?=E2=80=9D=20statement=20after=20inclusion=20of=20standard=20hea?= =?UTF-8?q?ders?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Otherwise clang emits this warning: using directive refers to implicitly-defined namespace 'std' --- src/DataTree.hh | 6 +++--- src/DynamicModel.hh | 6 +++--- src/DynareFlex.ll | 6 +++--- src/EquationTags.hh | 6 +++--- src/ExternalFunctionsTable.hh | 6 +++--- src/ModFile.hh | 6 +++--- src/ModelTree.hh | 6 +++--- src/NumericalConstants.hh | 6 +++--- src/NumericalInitialization.hh | 6 +++--- src/Shocks.hh | 6 +++--- src/StaticModel.hh | 6 +++--- src/SymbolTable.hh | 6 +++--- 12 files changed, 36 insertions(+), 36 deletions(-) diff --git a/src/DataTree.hh b/src/DataTree.hh index 565a0189..51514d48 100644 --- a/src/DataTree.hh +++ b/src/DataTree.hh @@ -1,5 +1,5 @@ /* - * Copyright © 2003-2021 Dynare Team + * Copyright © 2003-2022 Dynare Team * * This file is part of Dynare. * @@ -20,8 +20,6 @@ #ifndef _DATATREE_HH #define _DATATREE_HH -using namespace std; - #include <string> #include <map> #include <vector> @@ -36,6 +34,8 @@ using namespace std; #include "ExprNode.hh" #include "SubModel.hh" +using namespace std; + class DataTree { public: diff --git a/src/DynamicModel.hh b/src/DynamicModel.hh index 0605849c..51265ac1 100644 --- a/src/DynamicModel.hh +++ b/src/DynamicModel.hh @@ -1,5 +1,5 @@ /* - * Copyright © 2003-2021 Dynare Team + * Copyright © 2003-2022 Dynare Team * * This file is part of Dynare. * @@ -20,13 +20,13 @@ #ifndef _DYNAMICMODEL_HH #define _DYNAMICMODEL_HH -using namespace std; - #include <fstream> #include <filesystem> #include "StaticModel.hh" +using namespace std; + //! Stores a dynamic model class DynamicModel : public ModelTree { diff --git a/src/DynareFlex.ll b/src/DynareFlex.ll index e35d9253..ee37d65d 100644 --- a/src/DynareFlex.ll +++ b/src/DynareFlex.ll @@ -1,6 +1,6 @@ /* -*- C++ -*- */ /* - * Copyright © 2003-2021 Dynare Team + * Copyright © 2003-2022 Dynare Team * * This file is part of Dynare. * @@ -20,11 +20,11 @@ %{ -using namespace std; - #include <cstring> #include "ParsingDriver.hh" +using namespace std; + // Announce to Flex the prototype we want for lexing function #define YY_DECL \ Dynare::parser::token_type \ diff --git a/src/EquationTags.hh b/src/EquationTags.hh index 34277bae..04ed8a10 100644 --- a/src/EquationTags.hh +++ b/src/EquationTags.hh @@ -1,5 +1,5 @@ /* - * Copyright © 2020-2021 Dynare Team + * Copyright © 2020-2022 Dynare Team * * This file is part of Dynare. * @@ -20,12 +20,12 @@ #ifndef _EQUATION_TAGS_HH #define _EQUATION_TAGS_HH -using namespace std; - #include <map> #include <set> #include <string> +using namespace std; + class EquationTags { private: diff --git a/src/ExternalFunctionsTable.hh b/src/ExternalFunctionsTable.hh index ce4dde68..6c4a4d45 100644 --- a/src/ExternalFunctionsTable.hh +++ b/src/ExternalFunctionsTable.hh @@ -1,5 +1,5 @@ /* - * Copyright © 2010-2019 Dynare Team + * Copyright © 2010-2022 Dynare Team * * This file is part of Dynare. * @@ -20,13 +20,13 @@ #ifndef _EXTERNALFUNCTIONSTABLE_HH #define _EXTERNALFUNCTIONSTABLE_HH -using namespace std; - #include <iostream> #include <string> #include <vector> #include <map> +using namespace std; + //! Handles external functions class ExternalFunctionsTable { diff --git a/src/ModFile.hh b/src/ModFile.hh index d5942c84..4c2cd072 100644 --- a/src/ModFile.hh +++ b/src/ModFile.hh @@ -1,5 +1,5 @@ /* - * Copyright © 2006-2021 Dynare Team + * Copyright © 2006-2022 Dynare Team * * This file is part of Dynare. * @@ -20,8 +20,6 @@ #ifndef _MOD_FILE_HH #define _MOD_FILE_HH -using namespace std; - #include <ostream> #include <ctime> #include <iostream> @@ -40,6 +38,8 @@ using namespace std; #include "ExtendedPreprocessorTypes.hh" #include "SubModel.hh" +using namespace std; + //! The abstract representation of a "mod" file class ModFile { diff --git a/src/ModelTree.hh b/src/ModelTree.hh index 5421792c..4c5b1810 100644 --- a/src/ModelTree.hh +++ b/src/ModelTree.hh @@ -1,5 +1,5 @@ /* - * Copyright © 2003-2021 Dynare Team + * Copyright © 2003-2022 Dynare Team * * This file is part of Dynare. * @@ -20,8 +20,6 @@ #ifndef _MODELTREE_HH #define _MODELTREE_HH -using namespace std; - #include <string> #include <vector> #include <deque> @@ -34,6 +32,8 @@ using namespace std; #include "EquationTags.hh" #include "ExtendedPreprocessorTypes.hh" +using namespace std; + // Helper to convert a vector into a tuple template<typename T, size_t... Indices> auto diff --git a/src/NumericalConstants.hh b/src/NumericalConstants.hh index 70ed6d09..f8355011 100644 --- a/src/NumericalConstants.hh +++ b/src/NumericalConstants.hh @@ -1,5 +1,5 @@ /* - * Copyright © 2003-2016 Dynare Team + * Copyright © 2003-2022 Dynare Team * * This file is part of Dynare. * @@ -20,12 +20,12 @@ #ifndef _NUMERICALCONSTANTS_HH #define _NUMERICALCONSTANTS_HH -using namespace std; - #include <string> #include <vector> #include <map> +using namespace std; + //! Handles non-negative numerical constants class NumericalConstants { diff --git a/src/NumericalInitialization.hh b/src/NumericalInitialization.hh index 1ff828f6..2c58656c 100644 --- a/src/NumericalInitialization.hh +++ b/src/NumericalInitialization.hh @@ -1,5 +1,5 @@ /* - * Copyright © 2003-2021 Dynare Team + * Copyright © 2003-2022 Dynare Team * * This file is part of Dynare. * @@ -20,8 +20,6 @@ #ifndef _NUMERICALINITIALIZATION_HH #define _NUMERICALINITIALIZATION_HH -using namespace std; - #include <string> #include <vector> #include <map> @@ -30,6 +28,8 @@ using namespace std; #include "ExprNode.hh" #include "Statement.hh" +using namespace std; + class InitParamStatement : public Statement { private: diff --git a/src/Shocks.hh b/src/Shocks.hh index b2b22155..83ec46e9 100644 --- a/src/Shocks.hh +++ b/src/Shocks.hh @@ -1,5 +1,5 @@ /* - * Copyright © 2003-2021 Dynare Team + * Copyright © 2003-2022 Dynare Team * * This file is part of Dynare. * @@ -20,8 +20,6 @@ #ifndef _SHOCKS_HH #define _SHOCKS_HH -using namespace std; - #include <string> #include <vector> #include <map> @@ -30,6 +28,8 @@ using namespace std; #include "SymbolTable.hh" #include "ExprNode.hh" +using namespace std; + class AbstractShocksStatement : public Statement { public: diff --git a/src/StaticModel.hh b/src/StaticModel.hh index c2fc1d6f..29b2b864 100644 --- a/src/StaticModel.hh +++ b/src/StaticModel.hh @@ -1,5 +1,5 @@ /* - * Copyright © 2003-2020 Dynare Team + * Copyright © 2003-2022 Dynare Team * * This file is part of Dynare. * @@ -20,13 +20,13 @@ #ifndef _STATIC_MODEL_HH #define _STATIC_MODEL_HH -using namespace std; - #include <fstream> #include <filesystem> #include "ModelTree.hh" +using namespace std; + class DynamicModel; //! Stores a static model, as derived from the "model" block when leads and lags have been removed diff --git a/src/SymbolTable.hh b/src/SymbolTable.hh index 9d3579ac..cb4a7ab7 100644 --- a/src/SymbolTable.hh +++ b/src/SymbolTable.hh @@ -1,5 +1,5 @@ /* - * Copyright © 2003-2021 Dynare Team + * Copyright © 2003-2022 Dynare Team * * This file is part of Dynare. * @@ -20,8 +20,6 @@ #ifndef _SYMBOLTABLE_HH #define _SYMBOLTABLE_HH -using namespace std; - #include <map> #include <string> #include <utility> @@ -32,6 +30,8 @@ using namespace std; #include "CodeInterpreter.hh" #include "ExprNode.hh" +using namespace std; + using expr_t = class ExprNode *; //! Types of auxiliary variables -- GitLab