Added emplace functions supporting up to four parameters to the following containers.

forward_list
list
vector
queue
priority_queue
stack

# Conflicts:
#	src/vector.h
#	test/data.h
#	test/vs2017/random.csv
This commit is contained in:
John Wellbelove 2017-07-21 12:00:15 +01:00
parent c981bd0c96
commit f526a0172f
3 changed files with 6 additions and 6 deletions

View File

@ -1,5 +1,5 @@
name=Embedded Template Library
version=9.1.8
version=9.2.0
author= John Wellbelove <john.wellbelove@etlcpp.com>
maintainer=John Wellbelove <john.wellbelove@etlcpp.com>
sentence=A C++ template library tailored for embedded systems.

View File

@ -285,7 +285,7 @@ namespace etl
ETL_ASSERT(!full(), ETL_ERROR(queue_full));
#endif
::new (&p_buffer[in]) T(value1);
in = (in == (MAX_SIZE - 1)) ? 0 : in + 1;
in = (in == (CAPACITY - 1)) ? 0 : in + 1;
++current_size;
++construct_count;
}
@ -302,7 +302,7 @@ namespace etl
ETL_ASSERT(!full(), ETL_ERROR(queue_full));
#endif
::new (&p_buffer[in]) T(value1, value2);
in = (in == (MAX_SIZE - 1)) ? 0 : in + 1;
in = (in == (CAPACITY - 1)) ? 0 : in + 1;
++current_size;
++construct_count;
}
@ -319,7 +319,7 @@ namespace etl
ETL_ASSERT(!full(), ETL_ERROR(queue_full));
#endif
::new (&p_buffer[in]) T(value1, value2, value3);
in = (in == (MAX_SIZE - 1)) ? 0 : in + 1;
in = (in == (CAPACITY - 1)) ? 0 : in + 1;
++current_size;
++construct_count;
}
@ -336,7 +336,7 @@ namespace etl
ETL_ASSERT(!full(), ETL_ERROR(queue_full));
#endif
::new (&p_buffer[in]) T(value1, value2, value3, value4);
in = (in == (MAX_SIZE - 1)) ? 0 : in + 1;
in = (in == (CAPACITY - 1)) ? 0 : in + 1;
++current_size;
++construct_count;
}

View File

@ -471,7 +471,7 @@ namespace
CHECK_EQUAL(6U, data.size());
CHECK_EQUAL(6, std::distance(data.begin(), data.end()));
CHECK_EQUAL(std::distance(compare_data.begin(), compare_data.end()), data.size());
CHECK_EQUAL(size_t(std::distance(compare_data.begin(), compare_data.end())), data.size());
are_equal = std::equal(data.begin(), data.end(), compare_data.begin());
CHECK(are_equal);