From f526a0172f5908dca496c60ef9406a13e5c7bb15 Mon Sep 17 00:00:00 2001 From: John Wellbelove Date: Fri, 21 Jul 2017 12:00:15 +0100 Subject: [PATCH] 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 --- library.properties | 2 +- src/queue.h | 8 ++++---- test/test_forward_list.cpp | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/library.properties b/library.properties index 1c097c98..80a9cd15 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=Embedded Template Library -version=9.1.8 +version=9.2.0 author= John Wellbelove maintainer=John Wellbelove sentence=A C++ template library tailored for embedded systems. diff --git a/src/queue.h b/src/queue.h index aeec2304..67b77272 100644 --- a/src/queue.h +++ b/src/queue.h @@ -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; } diff --git a/test/test_forward_list.cpp b/test/test_forward_list.cpp index 16818f3a..b80ef653 100644 --- a/test/test_forward_list.cpp +++ b/test/test_forward_list.cpp @@ -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);