From 227d78578af4776040d802e2420cad2ad65234b3 Mon Sep 17 00:00:00 2001
From: Simon Praetorius <simon.praetorius@tu-dresden.de>
Date: Fri, 1 Mar 2019 11:25:39 +0100
Subject: [PATCH] added missing includes

---
 src/amdis/common/FieldMatVec.hpp |  2 ++
 src/amdis/common/TypeTraits.hpp  | 10 +++++-----
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/amdis/common/FieldMatVec.hpp b/src/amdis/common/FieldMatVec.hpp
index 7f2c226d..8c4aeb87 100644
--- a/src/amdis/common/FieldMatVec.hpp
+++ b/src/amdis/common/FieldMatVec.hpp
@@ -7,6 +7,8 @@
 #include <dune/common/fvector.hh>
 #include <dune/common/typetraits.hh>
 
+#include <amdis/common/TypeTraits.hpp>
+
 namespace std
 {
   template <class T, int N>
diff --git a/src/amdis/common/TypeTraits.hpp b/src/amdis/common/TypeTraits.hpp
index b7951278..721ec6f0 100644
--- a/src/amdis/common/TypeTraits.hpp
+++ b/src/amdis/common/TypeTraits.hpp
@@ -35,13 +35,13 @@ namespace AMDiS
     template <class T>
     struct UnderlyingType
     {
-      using type = T;
+      using type = remove_cvref_t<T>;
     };
 
     template <class T>
     struct UnderlyingType<std::reference_wrapper<T>>
     {
-      using type = T;
+      using type = remove_cvref_t<T>;
     };
   }
 
@@ -53,7 +53,7 @@ namespace AMDiS
   #define FWD(obj) std::forward<decltype(obj)>(obj)
 
   /// A decay version of decltype, similar to GCCs __typeof__
-  #define TYPEOF(...) remove_cvref_t<decltype(__VA_ARGS__)>
+  #define TYPEOF(...) AMDiS::remove_cvref_t<decltype(__VA_ARGS__)>
 
   /// Extract the static value of an integral_constant variable
   #define VALUE(...) TYPEOF(__VA_ARGS__)::value
@@ -65,7 +65,7 @@ namespace AMDiS
   struct Types {};
 
   template <class... Ts>
-  using Types_t = Types<std::decay_t<Ts>...>;
+  using Types_t = Types<remove_cvref_t<Ts>...>;
 
 
   /// Alias that indicates ownership of resources
@@ -77,7 +77,7 @@ namespace AMDiS
   template <class Obj>
   auto makeUniquePtr(Obj&& obj)
   {
-    return std::make_unique<remove_cvref_t<Obj>>(FWD(obj));
+    return std::make_unique<TYPEOF(obj)>(FWD(obj));
   }
 
 } // end namespace AMDiS
-- 
GitLab