From 5e8c6cbee94e8a08345fcf818ea5da5d0ca298d3 Mon Sep 17 00:00:00 2001
From: Stephane Del Pino <stephane.delpino44@gmail.com>
Date: Fri, 8 Feb 2019 18:58:21 +0100
Subject: [PATCH] Fix static_assert to allow construction of CastArray

Replace std::is_trivial_v by is_trivially_castable to allow construction of
CastArray's of TinyVector's and TinyMatrix's
---
 src/utils/CastArray.hpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/utils/CastArray.hpp b/src/utils/CastArray.hpp
index 57a05cbb5..e6288b686 100644
--- a/src/utils/CastArray.hpp
+++ b/src/utils/CastArray.hpp
@@ -2,6 +2,7 @@
 #define CAST_ARRAY_HPP
 
 #include <Array.hpp>
+#include <PastisTraits.hpp>
 
 template <typename DataType,
           typename CastDataType>
@@ -64,7 +65,7 @@ class CastArray
   {
     static_assert((std::is_const_v<CastDataType> and std::is_const_v<DataType>) or
                   (not std::is_const_v<DataType>), "CastArray cannot remove const attribute");
-    static_assert(std::is_trivial_v<DataType>, "Defining CastArray from non trivial type is not allowed");
+    static_assert(is_trivially_castable<DataType>, "Defining CastArray from non trivially castable type is not allowed");
   }
 
   PASTIS_INLINE
-- 
GitLab