diff options
| author | Clément Zrounba <6691770+clement-z@users.noreply.github.com> | 2023-09-30 23:06:01 +0200 |
|---|---|---|
| committer | Clément Zrounba <6691770+clement-z@users.noreply.github.com> | 2023-09-30 23:26:46 +0200 |
| commit | ff9b8bb838ecdfbfc1dc81038fcf3b2a87636982 (patch) | |
| tree | 21f27be782ce11c6d00b96ce100a2bff88141b2e /src/utils/pqueue.h | |
| download | specs-ff9b8bb838ecdfbfc1dc81038fcf3b2a87636982.tar.gz specs-ff9b8bb838ecdfbfc1dc81038fcf3b2a87636982.zip | |
Initial release
Diffstat (limited to 'src/utils/pqueue.h')
| -rw-r--r-- | src/utils/pqueue.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/utils/pqueue.h b/src/utils/pqueue.h new file mode 100644 index 0000000..4ec5dfd --- /dev/null +++ b/src/utils/pqueue.h @@ -0,0 +1,35 @@ +#pragma once + +#include <queue> +#include <vector> + +using std::priority_queue; +using std::vector; +using std::greater; +using std::size_t; + +template <class T> +class PQueue: public priority_queue<T, vector<T>, greater<T>>{ +public: + public: + typedef typename + std::priority_queue<T>::container_type::iterator iterator; + typedef typename + std::priority_queue<T>::container_type::const_iterator const_iterator; + + iterator begin() { + return this->c.begin(); + } + iterator end() { + return this->c.end(); + } + const_iterator cbegin() const { + return this->c.cbegin(); + } + const_iterator cend() const { + return this->c.cend(); + } + size_t size() const { + return this->c.size(); + } +}; |
