diff --git a/src/amdis/common/FieldMatVec.hpp b/src/amdis/common/FieldMatVec.hpp index 7f2c226d30ced45dddb04dfa3b1122ac57e5825f..8c4aeb876ec911b7fb7a10de7588951d24a34e9d 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 b79512786b1080456d4f859c9c89721d563150b1..721ec6f035b50dc43446919ea1d9b4d3ab538924 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