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