mirror of
https://github.com/NGSolve/netgen.git
synced 2024-11-11 16:49:16 +05:00
check for copy_assignable
This commit is contained in:
parent
b2b8a15611
commit
98697959dd
@ -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)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user