check for copy_assignable

This commit is contained in:
Joachim Schöberl 2020-09-09 06:31:03 +02:00
parent b2b8a15611
commit 98697959dd

View File

@ -940,7 +940,7 @@ namespace ngcore
/// array copy /// array copy
NETGEN_INLINE Array & operator= (const Array & a2) NETGEN_INLINE Array & operator= (const Array & a2)
{ {
if constexpr (std::is_assignable<T,T>::value) if constexpr (std::is_copy_assignable<T>::value)
{ {
SetSize0 (); SetSize0 ();
SetSize (a2.Size()); SetSize (a2.Size());
@ -952,6 +952,7 @@ namespace ngcore
throw Exception(std::string("cannot copy Array of type ") + typeid(T).name()); throw Exception(std::string("cannot copy Array of type ") + typeid(T).name());
} }
/// steal array /// steal array
NETGEN_INLINE Array & operator= (Array && a2) NETGEN_INLINE Array & operator= (Array && a2)
{ {