Changed 'Does nothing' comment to 'Undefined behavior'

This commit is contained in:
John Wellbelove 2016-11-13 16:25:09 +00:00
parent b468c8b3a4
commit e75f4bd248
5 changed files with 14 additions and 16 deletions

View File

@ -460,14 +460,15 @@ namespace etl
//*************************************************************************
/// Removes an element from the end of the string.
/// Does nothing if the string is empty.
/// Undefined behaviour if the string is empty.
//*************************************************************************
void pop_back()
{
if (current_size > 0)
{
p_buffer[--current_size] = 0;
}
#if defined(ETL_CHECK_PUSH_POP)
ETL_ASSERT(!empty(), ETL_ERROR(string_empty));
#endif
p_buffer[--current_size] = 0;
}
//*********************************************************************

View File

@ -180,17 +180,14 @@ namespace etl
//*************************************************************************
/// Removes the oldest value from the back of the priority queue.
/// Does nothing if the priority queue is already empty.
/// Undefined behaviour if the priority queue is already empty.
//*************************************************************************
void pop()
{
if (!empty())
{
// Move largest element to end
std::pop_heap(container.begin(), container.end(), TCompare());
// Actually remove largest element at end
container.pop_back();
}
// Move largest element to end
std::pop_heap(container.begin(), container.end(), TCompare());
// Actually remove largest element at end
container.pop_back();
}
//*************************************************************************

View File

@ -162,7 +162,7 @@ namespace etl
//*************************************************************************
/// Removes the oldest value from the back of the queue.
/// Does nothing if the queue is already empty.
/// Undefined behaviour if the queue is already empty.
//*************************************************************************
void pop()
{

View File

@ -135,7 +135,7 @@ namespace etl
//*************************************************************************
/// Removes the oldest item from the top of the stack.
/// Does nothing if the stack is already empty.
/// Undefined behaviour if the stack is already empty.
//*************************************************************************
void pop()
{

View File

@ -475,7 +475,7 @@ namespace etl
//*************************************************************************
/// Removes an element from the end of the vector.
/// Does nothing if the vector is empty.
/// Undefined behaviour if the vector is empty.
//*************************************************************************
void pop_back()
{