You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
//*************************************************************************
/// 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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: