Quantcast
Channel: C++ Queue Implementation - Code Review Stack Exchange
Browsing all 4 articles
Browse latest View live

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 Article



Answer 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 Article

Answer 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 Article

C++ 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
Browsing all 4 articles
Browse latest View live




Latest Images