#ifndef PRIORITYQUEUE_HPP
#define PRIORITYQUEUE_HPP
#include <vector>
template <class Object>
class PriorityQueue
{
public:
typedef bool (*CompareFunc)(Object &a, Object &b);
PriorityQueue(CompareFunc compare);<--- Class 'PriorityQueue' has a constructor with 1 argument that is not explicit. [+]Class 'PriorityQueue' has a constructor with 1 argument that is not explicit. Such constructors should in general be explicit for type safety reasons. Using the explicit keyword in the constructor means some mistakes when using the class can be avoided.
<--- Class 'PriorityQueue' has a constructor with 1 argument that is not explicit. [+]Class 'PriorityQueue' has a constructor with 1 argument that is not explicit. Such constructors should in general be explicit for type safety reasons. Using the explicit keyword in the constructor means some mistakes when using the class can be avoided.
<--- Class 'PriorityQueue' has a constructor with 1 argument that is not explicit. [+]Class 'PriorityQueue' has a constructor with 1 argument that is not explicit. Such constructors should in general be explicit for type safety reasons. Using the explicit keyword in the constructor means some mistakes when using the class can be avoided.
int size() const;
bool empty() const;
const Object top() const;
void push(Object x);
void pop();
int where_is_item(Object &a, int start_index=1, bool queue_is_valid=false);
bool update_item(Object &a, bool queue_is_valid=false);
bool update_item(int object_index);
bool validate(int index=1);
private:
std::vector<Object> theItems;
CompareFunc lessThanFunc;
};
#include "PriorityQueue.cpp"
#endif