mirror of
https://github.com/NGSolve/netgen.git
synced 2025-01-13 06:30:34 +05:00
Fix ArrayMem & operator= (ArrayMem && a2)
This commit is contained in:
parent
39e4e2bc12
commit
372b0a3089
@ -1111,20 +1111,16 @@ namespace ngcore
|
|||||||
}
|
}
|
||||||
|
|
||||||
ArrayMem & operator= (ArrayMem && a2)
|
ArrayMem & operator= (ArrayMem && a2)
|
||||||
{
|
|
||||||
if (a2.mem_to_delete)
|
|
||||||
{
|
{
|
||||||
ngcore::Swap (mem_to_delete, a2.mem_to_delete);
|
ngcore::Swap (mem_to_delete, a2.mem_to_delete);
|
||||||
ngcore::Swap (data, a2.data);
|
|
||||||
ngcore::Swap (allocsize, a2.allocsize);
|
ngcore::Swap (allocsize, a2.allocsize);
|
||||||
ngcore::Swap (size, a2.size);
|
ngcore::Swap (size, a2.size);
|
||||||
}
|
ngcore::Swap (data, a2.data);
|
||||||
else
|
|
||||||
{
|
if (mem_to_delete==nullptr)
|
||||||
allocsize = S;
|
for (auto i : Range(size))
|
||||||
for (size_t i = 0; i < S; i++)
|
|
||||||
mem[i] = std::move(a2.mem[i]);
|
mem[i] = std::move(a2.mem[i]);
|
||||||
}
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user