Bladeren bron

Fix warnings and errors with gcc 6.3

Eric Ramat 7 jaren geleden
bovenliggende
commit
bf53b1a51b
2 gewijzigde bestanden met toevoegingen van 15 en 10 verwijderingen
  1. 4 2
      src/artis/kernel/AbstractCoupledModel.hpp
  2. 11 8
      src/artis/utils/Trace.hpp

+ 4 - 2
src/artis/kernel/AbstractCoupledModel.hpp

@@ -36,6 +36,9 @@
 
 namespace artis { namespace kernel {
 
+template < typename T, typename U, typename V, typename W >
+class Simulator;
+
 template < typename T, typename U, typename V, typename W >
 class AbstractCoupledModel : public AbstractModel < U, V >,
                              public States < T, U, V >,
@@ -50,8 +53,7 @@ class AbstractCoupledModel : public AbstractModel < U, V >,
                                         int > > SubModelInternals;
 
 #ifdef WITH_TRACE
-    template < typename T, typename U, typename V, typename W >
-    friend class Simulator;
+    friend class Simulator < T, U, V, W >;
 #endif
 
 public:

+ 11 - 8
src/artis/utils/Trace.hpp

@@ -218,14 +218,17 @@ public:
     {
         TraceElements < Time > result;
 
-        std::copy_if(TraceElements < Time >::begin(),
-                     TraceElements < Time >::end(), std::back_inserter(result),
-                     [model_name](TraceElement < Time > const & x)
-        { if(not x.get_kernel_info().empty())
-            if( x.get_kernel_info().tgt_model() == model_name)
-                    return true;
-            return x.get_model_name() == model_name;
-        });
+        std::copy_if(
+            TraceElements < Time >::begin(),
+            TraceElements < Time >::end(), std::back_inserter(result),
+            [model_name](TraceElement < Time > const & x) {
+                if (not x.get_kernel_info().empty()) {
+                    if (x.get_kernel_info().tgt_model() == model_name) {
+                        return true;
+                    }
+                }
+                return x.get_model_name() == model_name;
+            });
         return result;
     }