Library 4

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

View File

@ -37,7 +37,7 @@ QueueVec<Data>::QueueVec(const QueueVec& toCopy){
template <typename Data>
QueueVec<Data>::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<Data>::Empty() const noexcept{
template <typename Data>
ulong QueueVec<Data>::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;
}