//*************************************************************************
/// Removes the oldest value from the back of the queue.
/// Does nothing if the queue is already empty.
/// If asserts or exceptions are enabled, throws an etl::queue_empty if the queue is empty.
//*************************************************************************
void pop()
{
#if defined(ETL_CHECK_PUSH_POP)
ETL_ASSERT(!empty(), ETL_ERROR(queue_empty));
#endif
p_buffer[out].~T();
del_out();
}
void del_out()
{
if (++out == CAPACITY) ETL_UNLIKELY
{
out = 0;
}
--current_size;
ETL_DECREMENT_DEBUG_COUNT
}
bool empty() const
{
return current_size == 0;
}
Either the function or the documentation here is incorrect, when calling pop on an empty queue it does not do nothing. It does lower the current_size by 1 resulting in current_size -1. This in turn causes empty to return false which is incorrect.
Either the function or the documentation here is incorrect, when calling pop on an empty queue it does not do nothing. It does lower the current_size by 1 resulting in current_size -1. This in turn causes empty to return false which is incorrect.