diff --git a/include/etl/deque.h b/include/etl/deque.h index 8a514e27..aa075ac7 100644 --- a/include/etl/deque.h +++ b/include/etl/deque.h @@ -1742,7 +1742,7 @@ namespace etl /// If asserts or exceptions are enabled, throws an etl::deque_full if the deque is already full. //************************************************************************* template - void emplace_back(Args && ... args) + reference emplace_back(Args && ... args) { #if defined(ETL_CHECK_PUSH_POP) ETL_ASSERT(!full(), ETL_ERROR(deque_full)); @@ -1752,6 +1752,7 @@ namespace etl ++_end; ++current_size; ETL_INCREMENT_DEBUG_COUNT + return back(); } #else @@ -1761,7 +1762,7 @@ namespace etl /// If asserts or exceptions are enabled, throws an etl::deque_full if the deque is already full. //************************************************************************* template - void emplace_back(const T1& value1) + reference emplace_back(const T1& value1) { #if defined(ETL_CHECK_PUSH_POP) ETL_ASSERT(!full(), ETL_ERROR(deque_full)); @@ -1771,6 +1772,7 @@ namespace etl ++_end; ++current_size; ETL_INCREMENT_DEBUG_COUNT + return back(); } //************************************************************************* @@ -1778,7 +1780,7 @@ namespace etl /// If asserts or exceptions are enabled, throws an etl::deque_full if the deque is already full. //************************************************************************* template - void emplace_back(const T1& value1, const T2& value2) + reference emplace_back(const T1& value1, const T2& value2) { #if defined(ETL_CHECK_PUSH_POP) ETL_ASSERT(!full(), ETL_ERROR(deque_full)); @@ -1788,6 +1790,7 @@ namespace etl ++_end; ++current_size; ETL_INCREMENT_DEBUG_COUNT + return back(); } //************************************************************************* @@ -1795,7 +1798,7 @@ namespace etl /// If asserts or exceptions are enabled, throws an etl::deque_full if the deque is already full. //************************************************************************* template - void emplace_back(const T1& value1, const T2& value2, const T3& value3) + reference emplace_back(const T1& value1, const T2& value2, const T3& value3) { #if defined(ETL_CHECK_PUSH_POP) ETL_ASSERT(!full(), ETL_ERROR(deque_full)); @@ -1805,6 +1808,7 @@ namespace etl ++_end; ++current_size; ETL_INCREMENT_DEBUG_COUNT + return back(); } //************************************************************************* @@ -1812,7 +1816,7 @@ namespace etl /// If asserts or exceptions are enabled, throws an etl::deque_full if the deque is already full. //************************************************************************* template - void emplace_back(const T1& value1, const T2& value2, const T3& value3, const T4& value4) + reference emplace_back(const T1& value1, const T2& value2, const T3& value3, const T4& value4) { #if defined(ETL_CHECK_PUSH_POP) ETL_ASSERT(!full(), ETL_ERROR(deque_full)); @@ -1822,6 +1826,7 @@ namespace etl ++_end; ++current_size; ETL_INCREMENT_DEBUG_COUNT + return back(); } #endif @@ -1870,7 +1875,7 @@ namespace etl /// If asserts or exceptions are enabled, throws an etl::deque_full if the deque is already full. //************************************************************************* template - void emplace_front(Args && ... args) + reference emplace_front(Args && ... args) { #if defined(ETL_CHECK_PUSH_POP) ETL_ASSERT(!full(), ETL_ERROR(deque_full)); @@ -1880,6 +1885,7 @@ namespace etl ::new (&(*_begin)) T(etl::forward(args)...); ++current_size; ETL_INCREMENT_DEBUG_COUNT + return front(); } #else @@ -1889,7 +1895,7 @@ namespace etl /// If asserts or exceptions are enabled, throws an etl::deque_full if the deque is already full. //************************************************************************* template - void emplace_front(const T1& value1) + reference emplace_front(const T1& value1) { #if defined(ETL_CHECK_PUSH_POP) ETL_ASSERT(!full(), ETL_ERROR(deque_full)); @@ -1899,6 +1905,7 @@ namespace etl ::new (&(*_begin)) T(value1); ++current_size; ETL_INCREMENT_DEBUG_COUNT + return front(); } //************************************************************************* @@ -1906,7 +1913,7 @@ namespace etl /// If asserts or exceptions are enabled, throws an etl::deque_full if the deque is already full. //************************************************************************* template - void emplace_front(const T1& value1, const T2& value2) + reference emplace_front(const T1& value1, const T2& value2) { #if defined(ETL_CHECK_PUSH_POP) ETL_ASSERT(!full(), ETL_ERROR(deque_full)); @@ -1916,6 +1923,7 @@ namespace etl ::new (&(*_begin)) T(value1, value2); ++current_size; ETL_INCREMENT_DEBUG_COUNT + return front(); } //************************************************************************* @@ -1923,7 +1931,7 @@ namespace etl /// If asserts or exceptions are enabled, throws an etl::deque_full if the deque is already full. //************************************************************************* template - void emplace_front(const T1& value1, const T2& value2, const T3& value3) + reference emplace_front(const T1& value1, const T2& value2, const T3& value3) { #if defined(ETL_CHECK_PUSH_POP) ETL_ASSERT(!full(), ETL_ERROR(deque_full)); @@ -1933,6 +1941,7 @@ namespace etl ::new (&(*_begin)) T(value1, value2, value3); ++current_size; ETL_INCREMENT_DEBUG_COUNT + return front(); } //************************************************************************* @@ -1940,7 +1949,7 @@ namespace etl /// If asserts or exceptions are enabled, throws an etl::deque_full if the deque is already full. //************************************************************************* template - void emplace_front(const T1& value1, const T2& value2, const T3& value3, const T4& value4) + reference emplace_front(const T1& value1, const T2& value2, const T3& value3, const T4& value4) { #if defined(ETL_CHECK_PUSH_POP) ETL_ASSERT(!full(), ETL_ERROR(deque_full)); @@ -1950,6 +1959,7 @@ namespace etl ::new (&(*_begin)) T(value1, value2, value3, value4); ++current_size; ETL_INCREMENT_DEBUG_COUNT + return front(); } #endif diff --git a/include/etl/forward_list.h b/include/etl/forward_list.h index 466a8cee..8d1ac9d5 100644 --- a/include/etl/forward_list.h +++ b/include/etl/forward_list.h @@ -722,7 +722,7 @@ namespace etl /// Emplaces a value to the front of the list.. //************************************************************************* template - void emplace_front(Args && ... args) + reference emplace_front(Args && ... args) { #if defined(ETL_CHECK_PUSH_POP) ETL_ASSERT(!full(), ETL_ERROR(forward_list_full)); @@ -731,13 +731,14 @@ namespace etl ::new (&(p_data_node->value)) T(etl::forward(args)...); ETL_INCREMENT_DEBUG_COUNT insert_node_after(start_node, *p_data_node); + return front(); } #else //************************************************************************* /// Emplaces a value to the front of the list.. //************************************************************************* template - void emplace_front(const T1& value1) + reference emplace_front(const T1& value1) { #if defined(ETL_CHECK_PUSH_POP) ETL_ASSERT(!full(), ETL_ERROR(forward_list_full)); @@ -746,13 +747,14 @@ namespace etl ::new (&(p_data_node->value)) T(value1); ETL_INCREMENT_DEBUG_COUNT insert_node_after(start_node, *p_data_node); + return front(); } //************************************************************************* /// Emplaces a value to the front of the list.. //************************************************************************* template - void emplace_front(const T1& value1, const T2& value2) + reference emplace_front(const T1& value1, const T2& value2) { #if defined(ETL_CHECK_PUSH_POP) ETL_ASSERT(!full(), ETL_ERROR(forward_list_full)); @@ -761,13 +763,14 @@ namespace etl ::new (&(p_data_node->value)) T(value1, value2); ETL_INCREMENT_DEBUG_COUNT insert_node_after(start_node, *p_data_node); + return front(); } //************************************************************************* /// Emplaces a value to the front of the list.. //************************************************************************* template - void emplace_front(const T1& value1, const T2& value2, const T3& value3) + reference emplace_front(const T1& value1, const T2& value2, const T3& value3) { #if defined(ETL_CHECK_PUSH_POP) ETL_ASSERT(!full(), ETL_ERROR(forward_list_full)); @@ -776,13 +779,14 @@ namespace etl ::new (&(p_data_node->value)) T(value1, value2, value3); ETL_INCREMENT_DEBUG_COUNT insert_node_after(start_node, *p_data_node); + return front(); } //************************************************************************* /// Emplaces a value to the front of the list.. //************************************************************************* template - void emplace_front(const T1& value1, const T2& value2, const T3& value3, const T4& value4) + reference emplace_front(const T1& value1, const T2& value2, const T3& value3, const T4& value4) { #if defined(ETL_CHECK_PUSH_POP) ETL_ASSERT(!full(), ETL_ERROR(forward_list_full)); @@ -791,6 +795,7 @@ namespace etl ::new (&(p_data_node->value)) T(value1, value2, value3, value4); ETL_INCREMENT_DEBUG_COUNT insert_node_after(start_node, *p_data_node); + return front(); } #endif // ETL_USING_CPP11 && ETL_NOT_USING_STLPORT diff --git a/include/etl/indirect_vector.h b/include/etl/indirect_vector.h index bf057662..78e592bf 100644 --- a/include/etl/indirect_vector.h +++ b/include/etl/indirect_vector.h @@ -782,10 +782,11 @@ namespace etl ///\param value The value to add. //********************************************************************* template - void emplace_back(Args && ... args) + reference emplace_back(Args && ... args) { T* p = storage.create(etl::forward(args)...); lookup.push_back(p); + return back(); } #else //********************************************************************* @@ -794,10 +795,11 @@ namespace etl ///\param value The value to add. //********************************************************************* template - void emplace_back(const T1& value1) + reference emplace_back(const T1& value1) { T* p = storage.create(T(value1)); lookup.push_back(p); + return back(); } //********************************************************************* @@ -806,10 +808,11 @@ namespace etl ///\param value The value to add. //********************************************************************* template - void emplace_back(const T1& value1, const T2& value2) + reference emplace_back(const T1& value1, const T2& value2) { T* p = storage.create(T(value1, value2)); lookup.push_back(p); + return back(); } //********************************************************************* @@ -818,10 +821,11 @@ namespace etl ///\param value The value to add. //********************************************************************* template - void emplace_back(const T1& value1, const T2& value2, const T3& value3) + reference emplace_back(const T1& value1, const T2& value2, const T3& value3) { T* p = storage.create(T(value1, value2, value3)); lookup.push_back(p); + return back(); } //********************************************************************* @@ -830,10 +834,11 @@ namespace etl ///\param value The value to add. //********************************************************************* template - void emplace_back(const T1& value1, const T2& value2, const T3& value3, const T4& value4) + reference emplace_back(const T1& value1, const T2& value2, const T3& value3, const T4& value4) { T* p = storage.create(T(value1, value2, value3, value4)); lookup.push_back(p); + return back(); } #endif diff --git a/include/etl/list.h b/include/etl/list.h index 6ba5070a..c5e78631 100644 --- a/include/etl/list.h +++ b/include/etl/list.h @@ -862,7 +862,7 @@ namespace etl /// Emplaces a value to the front of the list. //************************************************************************* template - void emplace_front(Args && ... args) + reference emplace_front(Args && ... args) { #if defined(ETL_CHECK_PUSH_POP) ETL_ASSERT(!full(), ETL_ERROR(list_full)); @@ -873,13 +873,14 @@ namespace etl ::new (&(p_data_node->value)) T(etl::forward(args)...); ETL_INCREMENT_DEBUG_COUNT insert_node(get_head(), *p_data_node); + return front(); } #else //************************************************************************* /// Emplaces a value to the front of the list. //************************************************************************* template - void emplace_front(const T1& value1) + reference emplace_front(const T1& value1) { #if defined(ETL_CHECK_PUSH_POP) ETL_ASSERT(!full(), ETL_ERROR(list_full)); @@ -890,13 +891,14 @@ namespace etl ::new (&(p_data_node->value)) T(value1); ETL_INCREMENT_DEBUG_COUNT insert_node(get_head(), *p_data_node); + return front(); } //************************************************************************* /// Emplaces a value to the front of the list. //************************************************************************* template - void emplace_front(const T1& value1, const T2& value2) + reference emplace_front(const T1& value1, const T2& value2) { #if defined(ETL_CHECK_PUSH_POP) ETL_ASSERT(!full(), ETL_ERROR(list_full)); @@ -907,13 +909,14 @@ namespace etl ::new (&(p_data_node->value)) T(value1, value2); ETL_INCREMENT_DEBUG_COUNT insert_node(get_head(), *p_data_node); + return front(); } //************************************************************************* /// Emplaces a value to the front of the list. //************************************************************************* template - void emplace_front(const T1& value1, const T2& value2, const T3& value3) + reference emplace_front(const T1& value1, const T2& value2, const T3& value3) { #if defined(ETL_CHECK_PUSH_POP) ETL_ASSERT(!full(), ETL_ERROR(list_full)); @@ -924,13 +927,14 @@ namespace etl ::new (&(p_data_node->value)) T(value1, value2, value3); ETL_INCREMENT_DEBUG_COUNT insert_node(get_head(), *p_data_node); + return front(); } //************************************************************************* /// Emplaces a value to the front of the list. //************************************************************************* template - void emplace_front(const T1& value1, const T2& value2, const T3& value3, const T4& value4) + reference emplace_front(const T1& value1, const T2& value2, const T3& value3, const T4& value4) { #if defined(ETL_CHECK_PUSH_POP) ETL_ASSERT(!full(), ETL_ERROR(list_full)); @@ -941,6 +945,7 @@ namespace etl ::new (&(p_data_node->value)) T(value1, value2, value3, value4); ETL_INCREMENT_DEBUG_COUNT insert_node(get_head(), *p_data_node); + return front(); } #endif @@ -985,7 +990,7 @@ namespace etl //************************************************************************* #if ETL_USING_CPP11 && ETL_NOT_USING_STLPORT template - void emplace_back(Args && ... args) + reference emplace_back(Args && ... args) { #if defined(ETL_CHECK_PUSH_POP) ETL_ASSERT(!full(), ETL_ERROR(list_full)); @@ -996,10 +1001,11 @@ namespace etl ::new (&(p_data_node->value)) T(etl::forward(args)...); ETL_INCREMENT_DEBUG_COUNT insert_node(terminal_node, *p_data_node); + return back(); } #else template - void emplace_back(const T1& value1) + reference emplace_back(const T1& value1) { #if defined(ETL_CHECK_PUSH_POP) ETL_ASSERT(!full(), ETL_ERROR(list_full)); @@ -1010,10 +1016,11 @@ namespace etl ::new (&(p_data_node->value)) T(value1); ETL_INCREMENT_DEBUG_COUNT insert_node(terminal_node, *p_data_node); + return back(); } template - void emplace_back(const T1& value1, const T2& value2) + reference emplace_back(const T1& value1, const T2& value2) { #if defined(ETL_CHECK_PUSH_POP) ETL_ASSERT(!full(), ETL_ERROR(list_full)); @@ -1024,10 +1031,11 @@ namespace etl ::new (&(p_data_node->value)) T(value1, value2); ETL_INCREMENT_DEBUG_COUNT insert_node(terminal_node, *p_data_node); + return back(); } template - void emplace_back(const T1& value1, const T2& value2, const T3& value3) + reference emplace_back(const T1& value1, const T2& value2, const T3& value3) { #if defined(ETL_CHECK_PUSH_POP) ETL_ASSERT(!full(), ETL_ERROR(list_full)); @@ -1038,10 +1046,11 @@ namespace etl ::new (&(p_data_node->value)) T(value1, value2, value3); ETL_INCREMENT_DEBUG_COUNT insert_node(terminal_node, *p_data_node); + return back(); } template - void emplace_back(const T1& value1, const T2& value2, const T3& value3, const T4& value4) + reference emplace_back(const T1& value1, const T2& value2, const T3& value3, const T4& value4) { #if defined(ETL_CHECK_PUSH_POP) ETL_ASSERT(!full(), ETL_ERROR(list_full)); @@ -1052,6 +1061,7 @@ namespace etl ::new (&(p_data_node->value)) T(value1, value2, value3, value4); ETL_INCREMENT_DEBUG_COUNT insert_node(terminal_node, *p_data_node); + return back(); } #endif diff --git a/include/etl/optional.h b/include/etl/optional.h index 4707d55b..bf5d791a 100644 --- a/include/etl/optional.h +++ b/include/etl/optional.h @@ -427,7 +427,7 @@ namespace etl ///\param args The arguments to construct with. //************************************************************************* template - void emplace(Args && ... args) + T& emplace(Args && ... args) { if (valid) { @@ -437,6 +437,7 @@ namespace etl ::new (storage.template get_address()) T(ETL_OR_STD::forward(args)...); valid = true; + return storage; } #else //************************************************************************* @@ -444,7 +445,7 @@ namespace etl /// 1 parameter. //************************************************************************* template - void emplace(const T1& value1) + T& emplace(const T1& value1) { if (valid) { @@ -454,6 +455,7 @@ namespace etl ::new (storage.template get_address()) T(value1); valid = true; + return storage; } //************************************************************************* @@ -461,7 +463,7 @@ namespace etl /// 2 parameters. //************************************************************************* template - void emplace(const T1& value1, const T2& value2) + T& emplace(const T1& value1, const T2& value2) { if (valid) { @@ -471,6 +473,7 @@ namespace etl ::new (storage.template get_address()) T(value1, value2); valid = true; + return storage; } //************************************************************************* @@ -478,7 +481,7 @@ namespace etl /// 3 parameters. //************************************************************************* template - void emplace(const T1& value1, const T2& value2, const T3& value3) + T& emplace(const T1& value1, const T2& value2, const T3& value3) { if (valid) { @@ -488,6 +491,7 @@ namespace etl ::new (storage.template get_address()) T(value1, value2, value3); valid = true; + return storage; } //************************************************************************* @@ -495,7 +499,7 @@ namespace etl /// 4 parameters. //************************************************************************* template - void emplace(const T1& value1, const T2& value2, const T3& value3, const T4& value4) + T& emplace(const T1& value1, const T2& value2, const T3& value3, const T4& value4) { if (valid) { @@ -505,6 +509,7 @@ namespace etl ::new (storage.template get_address()) T(value1, value2, value3, value4); valid = true; + return storage; } #endif diff --git a/include/etl/vector.h b/include/etl/vector.h index 86a30d40..b6ebec27 100644 --- a/include/etl/vector.h +++ b/include/etl/vector.h @@ -459,7 +459,7 @@ namespace etl ///\param value The value to add. //********************************************************************* template - void emplace_back(Args && ... args) + reference emplace_back(Args && ... args) { #if defined(ETL_CHECK_PUSH_POP) ETL_ASSERT(size() != CAPACITY, ETL_ERROR(vector_full)); @@ -467,6 +467,7 @@ namespace etl ::new (p_end) T(etl::forward(args)...); ++p_end; ETL_INCREMENT_DEBUG_COUNT + return back(); } #else //********************************************************************* @@ -475,7 +476,7 @@ namespace etl ///\param value The value to add. //********************************************************************* template - void emplace_back(const T1& value1) + reference emplace_back(const T1& value1) { #if defined(ETL_CHECK_PUSH_POP) ETL_ASSERT(size() != CAPACITY, ETL_ERROR(vector_full)); @@ -483,6 +484,7 @@ namespace etl ::new (p_end) T(value1); ++p_end; ETL_INCREMENT_DEBUG_COUNT + return back(); } //********************************************************************* @@ -491,7 +493,7 @@ namespace etl ///\param value The value to add. //********************************************************************* template - void emplace_back(const T1& value1, const T2& value2) + reference emplace_back(const T1& value1, const T2& value2) { #if defined(ETL_CHECK_PUSH_POP) ETL_ASSERT(size() != CAPACITY, ETL_ERROR(vector_full)); @@ -499,6 +501,7 @@ namespace etl ::new (p_end) T(value1, value2); ++p_end; ETL_INCREMENT_DEBUG_COUNT + return back(); } //********************************************************************* @@ -507,7 +510,7 @@ namespace etl ///\param value The value to add. //********************************************************************* template - void emplace_back(const T1& value1, const T2& value2, const T3& value3) + reference emplace_back(const T1& value1, const T2& value2, const T3& value3) { #if defined(ETL_CHECK_PUSH_POP) ETL_ASSERT(size() != CAPACITY, ETL_ERROR(vector_full)); @@ -515,6 +518,7 @@ namespace etl ::new (p_end) T(value1, value2, value3); ++p_end; ETL_INCREMENT_DEBUG_COUNT + return back(); } //********************************************************************* @@ -523,7 +527,7 @@ namespace etl ///\param value The value to add. //********************************************************************* template - void emplace_back(const T1& value1, const T2& value2, const T3& value3, const T4& value4) + reference emplace_back(const T1& value1, const T2& value2, const T3& value3, const T4& value4) { #if defined(ETL_CHECK_PUSH_POP) ETL_ASSERT(size() != CAPACITY, ETL_ERROR(vector_full)); @@ -531,6 +535,7 @@ namespace etl ::new (p_end) T(value1, value2, value3, value4); ++p_end; ETL_INCREMENT_DEBUG_COUNT + return back(); } #endif diff --git a/test/test_deque.cpp b/test/test_deque.cpp index 29c0b63d..d99d364b 100644 --- a/test/test_deque.cpp +++ b/test/test_deque.cpp @@ -1490,6 +1490,15 @@ namespace CHECK(std::equal(compare_data.begin(), compare_data.end(), data.begin())); } + //************************************************************************* + TEST(test_emplace_back_return) + { + DataNDC data; + + auto& back = data.emplace_back("42"); + CHECK_EQUAL(back, data.back()); + } + //************************************************************************* TEST(test_push_back_excess) { @@ -1602,6 +1611,15 @@ namespace CHECK(std::equal(compare_data.begin(), compare_data.end(), data.begin())); } + //************************************************************************* + TEST(test_emplace_front_return) + { + DataNDC data; + + auto& front = data.emplace_front("42"); + CHECK_EQUAL(front, data.front()); + } + //************************************************************************* TEST(test_push_front_excess) { diff --git a/test/test_forward_list.cpp b/test/test_forward_list.cpp index 21356c63..9e8a2712 100644 --- a/test/test_forward_list.cpp +++ b/test/test_forward_list.cpp @@ -694,6 +694,15 @@ namespace CHECK(are_equal); } + //************************************************************************* + TEST_FIXTURE(SetupFixture, test_emplace_front_return) + { + DataNDC data; + + auto& front = data.emplace_front("42"); + CHECK_EQUAL(front, data.front()); + } + //************************************************************************* TEST_FIXTURE(SetupFixture, test_emplace_after) { diff --git a/test/test_indirect_vector.cpp b/test/test_indirect_vector.cpp index 06ba7d2b..f6d3782b 100644 --- a/test/test_indirect_vector.cpp +++ b/test/test_indirect_vector.cpp @@ -715,6 +715,16 @@ namespace CHECK(is_equal); } + //************************************************************************* + TEST_FIXTURE(SetupFixture, test_emplace_back_return) + { + DataNDC data; + std::string value("A"); + + auto& back = data.emplace_back(value); + CHECK_EQUAL(back, data.back()); + } + //************************************************************************* TEST_FIXTURE(SetupFixture, test_push_back_unique_ptr) { diff --git a/test/test_list.cpp b/test/test_list.cpp index 5e3cfd11..56ac2d04 100644 --- a/test/test_list.cpp +++ b/test/test_list.cpp @@ -731,6 +731,15 @@ namespace CHECK(are_equal); } + //************************************************************************* + TEST_FIXTURE(SetupFixture, test_emplace_front_return) + { + DataNDC data; + + auto& front = data.emplace_front("42"); + CHECK_EQUAL(front, data.front()); + } + //************************************************************************* TEST_FIXTURE(SetupFixture, test_push_front_excess) { @@ -887,6 +896,15 @@ namespace CHECK(are_equal); } + //************************************************************************* + TEST_FIXTURE(SetupFixture, test_emplace_back_return) + { + DataNDC data; + + auto& back = data.emplace_back("42"); + CHECK_EQUAL(back, data.back()); + } + //************************************************************************* TEST_FIXTURE(SetupFixture, test_push_back_excess) { diff --git a/test/test_optional.cpp b/test/test_optional.cpp index 03eee1d1..9308af27 100644 --- a/test/test_optional.cpp +++ b/test/test_optional.cpp @@ -127,6 +127,13 @@ namespace CHECK_EQUAL(1, DataM::get_instance_count()); } + //************************************************************************* + TEST(test_emplace_return) + { + etl::optional data; + CHECK_EQUAL(42U, data.emplace(42U).value); + } + //************************************************************************* TEST(test_moveable) { diff --git a/test/test_vector.cpp b/test/test_vector.cpp index 70313f3f..747ccdd3 100644 --- a/test/test_vector.cpp +++ b/test/test_vector.cpp @@ -659,6 +659,13 @@ namespace CHECK(is_equal); } + //************************************************************************* + TEST_FIXTURE(SetupFixture, test_emplace_back_return) + { + Data data; + CHECK_EQUAL(42, data.emplace_back(42)); + } + //************************************************************************* TEST_FIXTURE(SetupFixture, test_push_back_literal) {