Skip to content
Snippets Groups Projects
Commit 5e8c6cbe authored by Stéphane Del Pino's avatar Stéphane Del Pino
Browse files

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
parent 953cd684
No related branches found
No related tags found
1 merge request!11Feature/mpi
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
#define CAST_ARRAY_HPP #define CAST_ARRAY_HPP
#include <Array.hpp> #include <Array.hpp>
#include <PastisTraits.hpp>
template <typename DataType, template <typename DataType,
typename CastDataType> typename CastDataType>
...@@ -64,7 +65,7 @@ class CastArray ...@@ -64,7 +65,7 @@ class CastArray
{ {
static_assert((std::is_const_v<CastDataType> and std::is_const_v<DataType>) or 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"); (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 PASTIS_INLINE
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment