Skip to content
Snippets Groups Projects

Set AssertError to inherit from std::runtime_error

Merged Stéphane Del Pino requested to merge feature/unit-tests into develop
1 file
+ 2
2
Compare changes
  • Side-by-side
  • Inline
+ 2
2
@@ -60,7 +60,7 @@ class [[nodiscard]] Array
@@ -60,7 +60,7 @@ class [[nodiscard]] Array
PUGS_INLINE
PUGS_INLINE
void fill(const DataType& data) const
void fill(const DataType& data) const
{
{
static_assert(not std::is_const<DataType>(), "Cannot modify Array of const");
static_assert(not std::is_const_v<DataType>, "Cannot modify Array of const");
Kokkos::deep_copy(m_values, data);
Kokkos::deep_copy(m_values, data);
}
}
@@ -72,7 +72,7 @@ class [[nodiscard]] Array
@@ -72,7 +72,7 @@ class [[nodiscard]] Array
static_assert(std::is_same<std::remove_const_t<DataType>, std::remove_const_t<DataType2>>(),
static_assert(std::is_same<std::remove_const_t<DataType>, std::remove_const_t<DataType2>>(),
"Cannot assign Array of different type");
"Cannot assign Array of different type");
// ensures that const is not lost through copy
// ensures that const is not lost through copy
static_assert(((std::is_const<DataType2>() and std::is_const<DataType>()) or not std::is_const<DataType2>()),
static_assert(((std::is_const_v<DataType2> and std::is_const_v<DataType>) or not std::is_const_v<DataType2>),
"Cannot assign Array of const to Array of non-const");
"Cannot assign Array of const to Array of non-const");
m_values = array.m_values;
m_values = array.m_values;
return *this;
return *this;
Loading