From f8cc3ae3556388b17493e34a7da3abb66468c2c4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= <sebastien@dynare.org>
Date: Mon, 4 Jun 2018 14:07:13 +0200
Subject: [PATCH] Port to C++11 using keyword

Performed using modernize-use-using from clang-tidy.

https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-using.html
---
 src/ComputingTasks.hh       | 4 ++--
 src/DataTree.hh             | 2 +-
 src/DynamicModel.hh         | 2 +-
 src/ExprNode.hh             | 4 ++--
 src/MinimumFeedbackSet.hh   | 2 +-
 src/ModelTree.hh            | 2 +-
 src/Shocks.hh               | 6 +++---
 src/SigmaeInitialization.hh | 4 ++--
 src/StaticModel.hh          | 2 +-
 src/SymbolTable.hh          | 2 +-
 10 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/src/ComputingTasks.hh b/src/ComputingTasks.hh
index 6baee0d1..554e0b5b 100644
--- a/src/ComputingTasks.hh
+++ b/src/ComputingTasks.hh
@@ -241,7 +241,7 @@ public:
     BinaryOpcode code;
     expr_t expression;
   };
-  typedef vector<Constraint> constraints_t;
+  using constraints_t = vector<Constraint>;
 private:
   const SymbolTable &symbol_table;
   const constraints_t constraints;
@@ -830,7 +830,7 @@ public:
     expr_t value;
   };
 
-  typedef vector< svar_identification_restriction > svar_identification_restrictions_t;
+  using svar_identification_restrictions_t = vector<svar_identification_restriction>;
 private:
   const svar_identification_restrictions_t restrictions;
   const bool upper_cholesky_present;
diff --git a/src/DataTree.hh b/src/DataTree.hh
index 117daa07..c1ab2bb9 100644
--- a/src/DataTree.hh
+++ b/src/DataTree.hh
@@ -105,7 +105,7 @@ protected:
   //! Internal implementation of ParamUsedWithLeadLag()
   bool ParamUsedWithLeadLagInternal() const;
 private:
-  typedef list<expr_t> node_list_t;
+  using node_list_t = list<expr_t>;
   //! The list of nodes
   node_list_t node_list;
   //! A counter for filling ExprNode's idx field
diff --git a/src/DynamicModel.hh b/src/DynamicModel.hh
index 12e7df74..32f28c9d 100644
--- a/src/DynamicModel.hh
+++ b/src/DynamicModel.hh
@@ -201,7 +201,7 @@ private:
   vector<derivative_t> derivative_endo, derivative_other_endo, derivative_exo, derivative_exo_det;
 
   //!List for each block and for each lag-lead all the other endogenous variables and exogenous variables
-  typedef set<int> var_t;
+  using var_t = set<int>;
   typedef map<int, var_t> lag_var_t;
   vector<lag_var_t> other_endo_block, exo_block, exo_det_block;
 
diff --git a/src/ExprNode.hh b/src/ExprNode.hh
index 7e50d3cd..410e15a5 100644
--- a/src/ExprNode.hh
+++ b/src/ExprNode.hh
@@ -39,7 +39,7 @@ class UnaryOpNode;
 class BinaryOpNode;
 class PacExpectationNode;
 
-typedef class ExprNode *expr_t;
+using expr_t = class ExprNode *;
 
 struct ExprNodeLess;
 
@@ -51,7 +51,7 @@ typedef set<expr_t, ExprNodeLess> temporary_terms_t;
 typedef map<expr_t, int> temporary_terms_idxs_t;
 
 //! set of temporary terms used in a block
-typedef set<int> temporary_terms_inuse_t;
+using temporary_terms_inuse_t = set<int>;
 
 typedef map<int, int> map_idx_t;
 
diff --git a/src/MinimumFeedbackSet.hh b/src/MinimumFeedbackSet.hh
index 066df3a7..8397b950 100644
--- a/src/MinimumFeedbackSet.hh
+++ b/src/MinimumFeedbackSet.hh
@@ -36,7 +36,7 @@ namespace MFS
                                               property<vertex_out_degree_t, int > > > > > VertexProperty_t;
   typedef adjacency_list<listS, listS, bidirectionalS, VertexProperty_t> AdjacencyList_t;
   typedef map<graph_traits<AdjacencyList_t>::vertex_descriptor, default_color_type> color_t;
-  typedef vector<AdjacencyList_t::vertex_descriptor> vector_vertex_descriptor_t;
+  using vector_vertex_descriptor_t = vector<AdjacencyList_t::vertex_descriptor>;
 
   //! Eliminate a vertex i
   /*! For a vertex i replace all edges e_k_i and e_i_j by a shorcut e_k_j and then Suppress the vertex i*/
diff --git a/src/ModelTree.hh b/src/ModelTree.hh
index 8c5683a1..b398b24f 100644
--- a/src/ModelTree.hh
+++ b/src/ModelTree.hh
@@ -44,7 +44,7 @@ typedef vector<pair< pair< BlockSimulationType, int>, pair<int, int> > > block_t
 typedef vector< pair<pair<int, int>, pair< int, expr_t > > > block_derivatives_equation_variable_laglead_nodeid_t;
 
 //! for all blocks derivatives description
-typedef vector<block_derivatives_equation_variable_laglead_nodeid_t> blocks_derivatives_t;
+using blocks_derivatives_t = vector<block_derivatives_equation_variable_laglead_nodeid_t>;
 
 //! Shared code for static and dynamic models
 class ModelTree : public DataTree
diff --git a/src/Shocks.hh b/src/Shocks.hh
index d170a080..cf5f3bf2 100644
--- a/src/Shocks.hh
+++ b/src/Shocks.hh
@@ -114,7 +114,7 @@ public:
     string lags;
     string lower_bound, upper_bound;
   };
-  typedef vector<Constraint> constraints_t;
+  using constraints_t = vector<Constraint>;
 private:
   constraints_t constraints;
   const SymbolTable &symbol_table;
@@ -134,7 +134,7 @@ public:
     int exo;
     string periods, lower_bound, upper_bound;
   };
-  typedef vector<Constraint> constraints_t;
+  using constraints_t = vector<Constraint>;
 private:
   constraints_t constraints;
   const SymbolTable &symbol_table;
@@ -155,7 +155,7 @@ public:
     string name;
     vector<string> list;
   };
-  typedef vector<Group> group_t;
+  using group_t = vector<Group>;
 private:
   group_t shock_groups;
   vector<string> group_names;
diff --git a/src/SigmaeInitialization.hh b/src/SigmaeInitialization.hh
index 45c95f54..602d9a22 100644
--- a/src/SigmaeInitialization.hh
+++ b/src/SigmaeInitialization.hh
@@ -37,9 +37,9 @@ public:
       eUpper = 1               //!< Upper triangular matrix
     };
   //! Type of a matrix row
-  typedef vector<expr_t> row_t;
+  using row_t = vector<expr_t>;
   //! Type of a complete matrix
-  typedef vector<row_t> matrix_t;
+  using matrix_t = vector<row_t>;
 
   //! An exception indicating that a matrix is neither upper triangular nor lower triangular
   class MatrixFormException
diff --git a/src/StaticModel.hh b/src/StaticModel.hh
index 4c595c45..fcdd59f6 100644
--- a/src/StaticModel.hh
+++ b/src/StaticModel.hh
@@ -129,7 +129,7 @@ protected:
   vector<derivative_t> derivative_endo, derivative_other_endo, derivative_exo, derivative_exo_det;
 
   //!List for each block and for each lag-leag all the other endogenous variables and exogenous variables
-  typedef set<int> var_t;
+  using var_t = set<int>;
   typedef map<int, var_t> lag_var_t;
   vector<lag_var_t> other_endo_block, exo_block, exo_det_block;
 
diff --git a/src/SymbolTable.hh b/src/SymbolTable.hh
index f2bee241..dc7291e7 100644
--- a/src/SymbolTable.hh
+++ b/src/SymbolTable.hh
@@ -32,7 +32,7 @@ using namespace std;
 #include "CodeInterpreter.hh"
 #include "ExprNode.hh"
 
-typedef class ExprNode *expr_t;
+using expr_t = class ExprNode *;
 
 //! Types of auxiliary variables
 enum aux_var_t
-- 
GitLab