mirror of
https://github.com/NGSolve/netgen.git
synced 2024-11-11 16:49:16 +05:00
static_assert instead of Exception
This commit is contained in:
parent
371aad4a65
commit
566c858771
@ -749,15 +749,16 @@ namespace ngcore
|
||||
NETGEN_INLINE explicit Array (const Array & a2)
|
||||
: FlatArray<T,IndexType> (a2.Size(), a2.Size() ? new T[a2.Size()] : nullptr)
|
||||
{
|
||||
if constexpr (std::is_copy_assignable<T>::value)
|
||||
static_assert(std::is_copy_assignable<T>::value, "cannot copy-construct Array");
|
||||
// if constexpr (std::is_copy_assignable<T>::value)
|
||||
{
|
||||
allocsize = size;
|
||||
mem_to_delete = data;
|
||||
for (size_t i = 0; i < size; i++)
|
||||
data[i] = a2.data[i];
|
||||
}
|
||||
else
|
||||
throw Exception(std::string("cannot copy-construct Array of type ") + typeid(T).name());
|
||||
// else
|
||||
// throw Exception(std::string("cannot copy-construct Array of type ") + typeid(T).name());
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user