diff options
author | Loic Blot <loic.blot@unix-experience.fr> | 2015-03-04 17:48:07 +0100 |
---|---|---|
committer | Craig Robbins <kde.psych@gmail.com> | 2015-03-05 16:49:51 +1000 |
commit | b214cde5b4a833e1826ec6850b95bf1938c8b0a0 (patch) | |
tree | 1692546699da08769e7d5e6c10435fb037924aa3 /src/util | |
parent | 9e675793155d7cd56bbd2222df7b45245008c647 (diff) | |
download | minetest-b214cde5b4a833e1826ec6850b95bf1938c8b0a0.tar.gz minetest-b214cde5b4a833e1826ec6850b95bf1938c8b0a0.tar.bz2 minetest-b214cde5b4a833e1826ec6850b95bf1938c8b0a0.zip |
Remove Queue class which uses std::list and use native std::queue
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/container.h | 61 |
1 files changed, 0 insertions, 61 deletions
diff --git a/src/util/container.h b/src/util/container.h index 3ffd885e4..7945df54b 100644 --- a/src/util/container.h +++ b/src/util/container.h @@ -184,67 +184,6 @@ private: }; /* -FIFO queue (well, actually a FILO also) -*/ -template<typename T> -class Queue -{ -public: - Queue(): - m_list_size(0) - {} - - void push_back(T t) - { - m_list.push_back(t); - ++m_list_size; - } - - void push_front(T t) - { - m_list.push_front(t); - ++m_list_size; - } - - T pop_front() - { - if(m_list.empty()) - throw ItemNotFoundException("Queue: queue is empty"); - - typename std::list<T>::iterator begin = m_list.begin(); - T t = *begin; - m_list.erase(begin); - --m_list_size; - return t; - } - T pop_back() - { - if(m_list.empty()) - throw ItemNotFoundException("Queue: queue is empty"); - - typename std::list<T>::iterator last = m_list.back(); - T t = *last; - m_list.erase(last); - --m_list_size; - return t; - } - - u32 size() - { - return m_list_size; - } - - bool empty() - { - return m_list.empty(); - } - -protected: - std::list<T> m_list; - u32 m_list_size; -}; - -/* Thread-safe FIFO queue (well, actually a FILO also) */ |