diff --git a/librerie/exercise2/list/list.cpp b/librerie/exercise2/list/list.cpp index 3396301..05c06d1 100644 --- a/librerie/exercise2/list/list.cpp +++ b/librerie/exercise2/list/list.cpp @@ -167,7 +167,7 @@ void List::InsertAtBack(const Data& data){ template void List::InsertAtBack(Data&& data){ if(size == 0){ - InsertAtFront(data); + InsertAtFront(std::move(data)); } else{ struct Node* last = new Node(std::move(data)); diff --git a/librerie/exercise2/queue/vec/queuevec.cpp b/librerie/exercise2/queue/vec/queuevec.cpp index 42f6857..a76066f 100755 --- a/librerie/exercise2/queue/vec/queuevec.cpp +++ b/librerie/exercise2/queue/vec/queuevec.cpp @@ -37,7 +37,7 @@ QueueVec::QueueVec(const QueueVec& toCopy){ template QueueVec::QueueVec(QueueVec&& toMove) noexcept{ - Clear(); + Clear(); // the moved Queue will be in a consistent state std::swap(Elements, toMove.Elements); std::swap(rear, toMove.rear); std::swap(front, toMove.front); @@ -140,7 +140,7 @@ bool QueueVec::Empty() const noexcept{ template ulong QueueVec::Size() const noexcept{ - //if(size == 0) return 0; // this won't ever get executed, it's here just in case + //if(size == 0) return 0; // this won't ever get executed, it's here just in case return ((rear + size) - front) % size; } diff --git a/librerie/exercise2/stack/lst/stacklst.cpp b/librerie/exercise2/stack/lst/stacklst.cpp index f1f24d8..a9b6cdc 100755 --- a/librerie/exercise2/stack/lst/stacklst.cpp +++ b/librerie/exercise2/stack/lst/stacklst.cpp @@ -52,7 +52,7 @@ void StackLst::Push(const Data& element){ template void StackLst::Push(Data&& element) noexcept{ - List::InsertAtFront(element); + List::InsertAtFront(std::move(element)); } template diff --git a/librerie/exercise2/stack/vec/stackvec.cpp b/librerie/exercise2/stack/vec/stackvec.cpp index eabb6ad..ca711d3 100755 --- a/librerie/exercise2/stack/vec/stackvec.cpp +++ b/librerie/exercise2/stack/vec/stackvec.cpp @@ -44,7 +44,7 @@ StackVec& StackVec::operator=(const StackVec& copyFrom){ template StackVec& StackVec::operator=(StackVec&& moveFrom) noexcept{ Vector::operator=(std::move(moveFrom)); - stackSize = moveFrom.Size(); + std::swap(stackSize, moveFrom.stackSize); return *this; }