Library 5

This commit is contained in:
Alessandro Ferro
2021-06-09 12:11:53 +02:00
parent 084a2df94e
commit ed5f80bb78
7 changed files with 12 additions and 11 deletions

View File

@ -117,12 +117,14 @@ BinaryTreeVec<Data>& BinaryTreeVec<Data>::operator=(const BinaryTreeVec<Data>& b
template <typename Data>
BinaryTreeVec<Data>& BinaryTreeVec<Data>::operator=(BinaryTreeVec<Data>&& bt) noexcept{
Clear();
std::swap(size, bt.size);
std::swap(tree, bt.tree);
for(ulong i=0 ; i<size ; ++i){
tree[i]->ReferenceToTree = this;
}
for(ulong j=0 ; j<bt.Size() ; ++j){
(bt.tree[j])->ReferenceToTree = &bt;
}
return *this;
}