diff --git a/src/utils/CastArray.hpp b/src/utils/CastArray.hpp
index 57a05cbb5f893c69ac74378c579520fe58c13a64..e6288b686c65f025847d82e95da43fc76ec49b37 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