assignment operator added

This commit is contained in:
Robin Müller 2020-09-10 15:03:28 +02:00
parent d43ef479b6
commit cefac2db0b

View File

@ -29,6 +29,17 @@ public:
this->setContainer(fifoArray.data()); this->setContainer(fifoArray.data());
} }
/**
* @brief Custom assignment operator
* @param other
*/
FIFO& operator=(const FIFO& other){
FIFOBase<T>::operator=(other);
this->fifoArray = other.fifoArray;
this->setContainer(fifoArray.data());
return *this;
}
private: private:
std::array<T, capacity> fifoArray; std::array<T, capacity> fifoArray;
}; };