Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // WORKING
- template <class T>
- PrioQueue<T> PrioQueue<T>::operator*(PrioQueue<T> other) {
- PrioQueue<T> newPrioQueue;
- while (!this->queue.empty()) {
- while (!other.queue.empty()) {
- if (this->queue.top() == other.queue.top()) {
- newPrioQueue.queue.push(other.queue.top());
- }
- other.queue.pop();
- this->queue.pop();
- }
- }
- return newPrioQueue;
- }
- // NOT WORKING
- template <class T>
- PrioQueue<T> PrioQueue<T>::operator*(PrioQueue<T> other) {
- PrioQueue<T> newPrioQueue;
- while (!this->queue.empty()) {
- while (!other.queue.empty()) {
- if (this->queue.top() == other.queue.top()) {
- newPrioQueue.queue.push(other.queue.top());
- other.queue.pop();
- }
- this->queue.pop();
- }
- }
- return newPrioQueue;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement