Answer by coderodde for C++ Queue Implementation
I have only a couple of minor comments:1void push(T element) { if (m_endIndex == m_startIndex && m_size > 0) { // expand queue expand_queue(); } m_buffer[m_endIndex] = element; m_endIndex =...
View ArticleAnswer by forsvarir for C++ Queue Implementation
Yes, your class is functionally different from the queue provided by the stl. This line:m_buffer = new T[capacity];Means that the type T has to provide a default constructor. This limitation is not...
View ArticleAnswer by Benoît for C++ Queue Implementation
Please use std::vector instead of T* because you clearly don't know what you are doing (missing operator=, copy-constructor, etc). Better, make the underlying container a template parameter.The...
View ArticleC++ Queue Implementation
so I wrote a queue implementation in c++ and even though I know the code probably isn't as robust as it should be and probably doesn't perform all the checks it should, I'd like to know mostly if there...
View Article
More Pages to Explore .....