#Custom deque class with custom pushback() push back at first but then push front I dont know why

7 messages · Page 1 of 1 (latest)

kind turret
#
template <typename T>
void deque<T>::push_back(const T& val)
{

    if (m_cap == m_size) {
        reserve(m_cap * 2);
    }


    m_tab[((m_zero + m_size)-1) % m_cap] = new T(val);

    m_size++;
}```
south swanBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.

kind turret
#

Custom deque pushback push back at first but then push front I dont know why

#

Custom deque class with custom pushback() push back at first but then push front I dont know why

covert plume
#

Can you better explain the issue?

kind turret
#

I just found the solution by myself thanks! haha

#

!solved