diff --git a/include/etl/deque.h b/include/etl/deque.h index 15ea7802..f4a1b820 100644 --- a/include/etl/deque.h +++ b/include/etl/deque.h @@ -976,7 +976,7 @@ namespace etl /// If asserts or exceptions are enabled, throws an etl::deque_full if the deque is full. ///\param insert_position>The insert position. //************************************************************************* -#if ETL_CPP11_SUPPORTED && !defined(ETL_STLPORT) && !defined(ETL_NO_STL) +#if ETL_CPP11_SUPPORTED && !defined(ETL_STLPORT) template iterator emplace(const_iterator insert_position, Args && ... args) { @@ -1298,7 +1298,7 @@ namespace etl return position; } -#endif // ETL_CPP11_SUPPORTED && !defined(ETL_STLPORT) && !defined(ETL_NO_STL) +#endif //************************************************************************* /// Inserts 'n' copies of a value into the deque. @@ -1647,7 +1647,7 @@ namespace etl } #endif -#if ETL_CPP11_SUPPORTED && !defined(ETL_STLPORT) && !defined(ETL_NO_STL) +#if ETL_CPP11_SUPPORTED && !defined(ETL_STLPORT) //************************************************************************* /// Emplaces an item to the back of the deque. /// If asserts or exceptions are enabled, throws an etl::deque_full if the deque is already full. @@ -1734,7 +1734,7 @@ namespace etl ++current_size; ETL_INCREMENT_DEBUG_COUNT } -#endif // ETL_CPP11_SUPPORTED && !defined(ETL_STLPORT) && !defined(ETL_NO_STL) +#endif //************************************************************************* /// Removes the oldest item from the deque. @@ -1775,7 +1775,7 @@ namespace etl } #endif -#if ETL_CPP11_SUPPORTED && !defined(ETL_STLPORT) && !defined(ETL_NO_STL) +#if ETL_CPP11_SUPPORTED && !defined(ETL_STLPORT) //************************************************************************* /// Emplaces an item to the front of the deque. /// If asserts or exceptions are enabled, throws an etl::deque_full if the deque is already full. @@ -1862,7 +1862,7 @@ namespace etl ++current_size; ETL_INCREMENT_DEBUG_COUNT } -#endif // ETL_CPP11_SUPPORTED && !defined(ETL_STLPORT) && !defined(ETL_NO_STL) +#endif //************************************************************************* /// Removes the oldest item from the deque. diff --git a/include/etl/flat_map.h b/include/etl/flat_map.h index 1d83deac..3022b969 100644 --- a/include/etl/flat_map.h +++ b/include/etl/flat_map.h @@ -338,7 +338,7 @@ namespace etl return emplace(value.first, value.second); } -#if ETL_CPP11_SUPPORTED && !defined(ETL_STLPORT) && !defined(ETL_NO_STL) +#if ETL_CPP11_SUPPORTED && !defined(ETL_STLPORT) //************************************************************************* /// Emplaces a value to the map. //************************************************************************* @@ -501,7 +501,7 @@ namespace etl return result; } -#endif // ETL_CPP11_SUPPORTED && !defined(ETL_STLPORT) && !defined(ETL_NO_STL) +#endif //********************************************************************* /// Erases an element. diff --git a/include/etl/flat_multimap.h b/include/etl/flat_multimap.h index 54eed72f..979db740 100644 --- a/include/etl/flat_multimap.h +++ b/include/etl/flat_multimap.h @@ -320,7 +320,7 @@ namespace etl return refmap_t::insert_at(i_element, *pvalue); } -#if ETL_CPP11_SUPPORTED && !defined(ETL_STLPORT) && !defined(ETL_NO_STL) +#if ETL_CPP11_SUPPORTED && !defined(ETL_STLPORT) //************************************************************************* /// Emplaces a value to the map. //************************************************************************* @@ -412,7 +412,7 @@ namespace etl return refmap_t::insert_at(i_element, *pvalue); } -#endif // ETL_CPP11_SUPPORTED && !defined(ETL_STLPORT) && !defined(ETL_NO_STL) +#endif //********************************************************************* /// Erases an element. diff --git a/include/etl/flat_multiset.h b/include/etl/flat_multiset.h index 4c9e1bb9..51c74f74 100644 --- a/include/etl/flat_multiset.h +++ b/include/etl/flat_multiset.h @@ -281,7 +281,7 @@ namespace etl //************************************************************************* /// Emplaces a value to the set. //************************************************************************* -#if ETL_CPP11_SUPPORTED && !defined(ETL_STLPORT) && !defined(ETL_NO_STL) +#if ETL_CPP11_SUPPORTED && !defined(ETL_STLPORT) template std::pair emplace(Args && ... args) { @@ -368,7 +368,7 @@ namespace etl ETL_INCREMENT_DEBUG_COUNT return std::pair(refset_t::insert_at(i_element, *pvalue)); } -#endif // ETL_CPP11_SUPPORTED && !defined(ETL_STLPORT) && !defined(ETL_NO_STL) +#endif //********************************************************************* /// Erases an element. diff --git a/include/etl/flat_set.h b/include/etl/flat_set.h index 2d75a8d6..233f4a77 100644 --- a/include/etl/flat_set.h +++ b/include/etl/flat_set.h @@ -284,7 +284,7 @@ namespace etl //************************************************************************* /// Emplaces a value to the set. //************************************************************************* -#if ETL_CPP11_SUPPORTED && !defined(ETL_STLPORT) && !defined(ETL_NO_STL) +#if ETL_CPP11_SUPPORTED && !defined(ETL_STLPORT) template std::pair emplace(Args && ... args) { @@ -446,7 +446,7 @@ namespace etl return result; } -#endif // ETL_CPP11_SUPPORTED && !defined(ETL_STLPORT) && !defined(ETL_NO_STL) +#endif //********************************************************************* /// Erases an element. diff --git a/include/etl/list.h b/include/etl/list.h index 2123bb23..6c33c57a 100644 --- a/include/etl/list.h +++ b/include/etl/list.h @@ -867,7 +867,7 @@ namespace etl } #endif -#if ETL_CPP11_SUPPORTED && !defined(ETL_STLPORT) && !defined(ETL_NO_STL) +#if ETL_CPP11_SUPPORTED && !defined(ETL_STLPORT) //************************************************************************* /// Emplaces a value to the front of the list. //************************************************************************* @@ -952,7 +952,7 @@ namespace etl ETL_INCREMENT_DEBUG_COUNT insert_node(get_head(), *p_data_node); } -#endif // ETL_CPP11_SUPPORTED && !defined(ETL_STLPORT) && !defined(ETL_NO_STL) +#endif //************************************************************************* /// Removes a value from the front of the list. @@ -993,7 +993,7 @@ namespace etl //************************************************************************* /// Emplaces a value to the back of the list. //************************************************************************* -#if ETL_CPP11_SUPPORTED && !defined(ETL_STLPORT) && !defined(ETL_NO_STL) +#if ETL_CPP11_SUPPORTED && !defined(ETL_STLPORT) template void emplace_back(Args && ... args) { @@ -1063,7 +1063,7 @@ namespace etl ETL_INCREMENT_DEBUG_COUNT insert_node(terminal_node, *p_data_node); } -#endif // ETL_CPP11_SUPPORTED && !defined(ETL_STLPORT) && !defined(ETL_NO_STL) +#endif //************************************************************************* /// Removes a value from the back of the list. @@ -1108,7 +1108,7 @@ namespace etl //************************************************************************* /// Emplaces a value to the list at the specified position. //************************************************************************* -#if ETL_CPP11_SUPPORTED && !defined(ETL_STLPORT) && !defined(ETL_NO_STL) +#if ETL_CPP11_SUPPORTED && !defined(ETL_STLPORT) template iterator emplace(iterator position, Args && ... args) { @@ -1178,7 +1178,7 @@ namespace etl return iterator(*p_data_node); } -#endif // ETL_CPP11_SUPPORTED && !defined(ETL_STLPORT) && !defined(ETL_NO_STL) +#endif //************************************************************************* /// Inserts 'n' copies of a value to the list at the specified position. diff --git a/include/etl/priority_queue.h b/include/etl/priority_queue.h index 17c0118c..d84c0b9e 100644 --- a/include/etl/priority_queue.h +++ b/include/etl/priority_queue.h @@ -168,7 +168,7 @@ namespace etl std::push_heap(container.begin(), container.end(), compare); } -#if ETL_CPP11_SUPPORTED && !defined(ETL_STLPORT) && !defined(ETL_NO_STL) && !ETL_PRIORITY_QUEUE_FORCE_CPP03 +#if ETL_CPP11_SUPPORTED && !defined(ETL_STLPORT) && !defined(ETL_PRIORITY_QUEUE_FORCE_CPP03) //************************************************************************* /// Emplaces a value to the queue. /// If asserts or exceptions are enabled, throws an etl::priority_queue_full @@ -253,7 +253,7 @@ namespace etl // Make elements in container into heap std::push_heap(container.begin(), container.end(), compare); } -#endif // ETL_CPP11_SUPPORTED && !defined(ETL_STLPORT) && !defined(ETL_NO_STL) +#endif //************************************************************************* /// Assigns values to the priority queue. diff --git a/include/etl/queue.h b/include/etl/queue.h index 2af7100b..01399ccd 100644 --- a/include/etl/queue.h +++ b/include/etl/queue.h @@ -49,8 +49,6 @@ SOFTWARE. #undef ETL_FILE #define ETL_FILE "13" -#define ETL_QUEUE_FORCE_CPP03 0 - //***************************************************************************** ///\defgroup queue queue /// A First-in / first-out queue with the capacity defined at compile time, @@ -318,7 +316,7 @@ namespace etl add_in(); } -#if ETL_CPP11_SUPPORTED && !defined(ETL_STLPORT) && !defined(ETL_NO_STL) && !ETL_QUEUE_FORCE_CPP03 +#if ETL_CPP11_SUPPORTED && !defined(ETL_STLPORT) && !defined(ETL_QUEUE_FORCE_CPP03) //************************************************************************* /// Constructs a value in the queue 'in place'. /// If asserts or exceptions are enabled, throws an etl::queue_full if the queue if already full. @@ -393,7 +391,7 @@ namespace etl ::new (&p_buffer[in]) T(value1, value2, value3, value4); add_in(); } -#endif // ETL_CPP11_SUPPORTED && !defined(ETL_STLPORT) && !defined(ETL_NO_STL) +#endif //************************************************************************* /// Clears the queue to the empty state. diff --git a/include/etl/queue_mpmc_mutex.h b/include/etl/queue_mpmc_mutex.h index 75862fad..364952dc 100644 --- a/include/etl/queue_mpmc_mutex.h +++ b/include/etl/queue_mpmc_mutex.h @@ -162,7 +162,7 @@ namespace etl return result; } -#if ETL_CPP11_SUPPORTED && !defined(ETL_STLPORT) && !defined(ETL_NO_STL) && !ETL_QUEUE_MPMC_MUTEX_FORCE_CPP03 +#if ETL_CPP11_SUPPORTED && !defined(ETL_STLPORT) && !defined(ETL_QUEUE_MPMC_MUTEX_FORCE_CPP03) //************************************************************************* /// Constructs a value in the queue 'in place'. /// If asserts or exceptions are enabled, throws an etl::queue_full if the queue if already full. @@ -376,7 +376,7 @@ namespace etl return false; } -#if ETL_CPP11_SUPPORTED && !defined(ETL_STLPORT) && !defined(ETL_NO_STL) && !ETL_QUEUE_MPMC_MUTEX_FORCE_CPP03 +#if ETL_CPP11_SUPPORTED && !defined(ETL_STLPORT) && !defined(ETL_QUEUE_MPMC_MUTEX_FORCE_CPP03) //************************************************************************* /// Constructs a value in the queue 'in place'. //************************************************************************* diff --git a/include/etl/queue_spsc_atomic.h b/include/etl/queue_spsc_atomic.h index d2e5e861..152aaff6 100644 --- a/include/etl/queue_spsc_atomic.h +++ b/include/etl/queue_spsc_atomic.h @@ -222,7 +222,7 @@ namespace etl return false; } -#if ETL_CPP11_SUPPORTED && !defined(ETL_STLPORT) && !defined(ETL_NO_STL) && !ETL_QUEUE_ATOMIC_FORCE_CPP03 +#if ETL_CPP11_SUPPORTED && !defined(ETL_STLPORT) && !defined(ETL_QUEUE_ATOMIC_FORCE_CPP03) //************************************************************************* /// Constructs a value in the queue 'in place'. /// If asserts or exceptions are enabled, throws an etl::queue_full if the queue if already full. diff --git a/include/etl/queue_spsc_isr.h b/include/etl/queue_spsc_isr.h index 8842af48..e4918ad7 100644 --- a/include/etl/queue_spsc_isr.h +++ b/include/etl/queue_spsc_isr.h @@ -43,8 +43,6 @@ SOFTWARE. #undef ETL_FILE #define ETL_FILE "46" -#define ETL_QUEUE_ISR_FORCE_CPP03 0 - namespace etl { template @@ -76,7 +74,7 @@ namespace etl /// If asserts or exceptions are enabled, throws an etl::queue_full if the queue if already full. ///\param value The value to use to construct the item to push to the queue. //************************************************************************* -#if ETL_CPP11_SUPPORTED && !defined(ETL_STLPORT) && !defined(ETL_NO_STL) && !ETL_QUEUE_ISR_FORCE_CPP03 +#if ETL_CPP11_SUPPORTED && !defined(ETL_STLPORT) && !ETL_QUEUE_ISR_FORCE_CPP03 template bool emplace_from_isr(Args&&... args) { @@ -194,7 +192,7 @@ namespace etl return false; } -#if ETL_CPP11_SUPPORTED && !defined(ETL_STLPORT) && !defined(ETL_NO_STL) && !ETL_QUEUE_ISR_FORCE_CPP03 +#if ETL_CPP11_SUPPORTED && !defined(ETL_STLPORT) && !ETL_QUEUE_ISR_FORCE_CPP03 //************************************************************************* /// Constructs a value in the queue 'in place'. /// If asserts or exceptions are enabled, throws an etl::queue_full if the queue if already full. @@ -432,7 +430,7 @@ namespace etl /// Constructs a value in the queue 'in place'. /// If asserts or exceptions are enabled, throws an etl::queue_full if the queue if already full. //************************************************************************* -#if ETL_CPP11_SUPPORTED && !defined(ETL_STLPORT) && !defined(ETL_NO_STL) && !ETL_QUEUE_ISR_FORCE_CPP03 +#if ETL_CPP11_SUPPORTED && !defined(ETL_STLPORT) && !ETL_QUEUE_ISR_FORCE_CPP03 template bool emplace(Args&&... args) { diff --git a/include/etl/stack.h b/include/etl/stack.h index 20e2a35b..037dd0f7 100644 --- a/include/etl/stack.h +++ b/include/etl/stack.h @@ -263,7 +263,7 @@ namespace etl ::new (&p_buffer[top_index]) T(value); } -#if ETL_CPP11_SUPPORTED && !defined(ETL_STLPORT) && !defined(ETL_NO_STL) +#if ETL_CPP11_SUPPORTED && !defined(ETL_STLPORT) //************************************************************************* /// Constructs a value in the stack place'. /// If asserts or exceptions are enabled, throws an etl::stack_full if the stack is already full. @@ -338,7 +338,7 @@ namespace etl base_t::add_in(); ::new (&p_buffer[top_index]) T(value1, value2, value3, value4); } -#endif // ETL_CPP11_SUPPORTED && !defined(ETL_STLPORT) && !defined(ETL_NO_STL) +#endif //************************************************************************* /// Gets a const reference to the value at the top of the stack.
diff --git a/include/etl/variant.h b/include/etl/variant.h index ce57f085..94e49e33 100644 --- a/include/etl/variant.h +++ b/include/etl/variant.h @@ -711,7 +711,7 @@ namespace etl type_id = other.type_id; } -#if ETL_CPP11_SUPPORTED && !defined(ETL_STLPORT) && !defined(ETL_NO_STL) && !ETL_VARIANT_FORCE_CPP03 +#if ETL_CPP11_SUPPORTED && !defined(ETL_STLPORT) && !defined(ETL_VARIANT_FORCE_CPP03) //************************************************************************* /// Emplace with variadic constructor parameters. //************************************************************************* diff --git a/include/etl/vector.h b/include/etl/vector.h index b12ef04c..577241ce 100644 --- a/include/etl/vector.h +++ b/include/etl/vector.h @@ -62,8 +62,6 @@ SOFTWARE. #pragma GCC diagnostic ignored "-Wunused-variable" #endif -#define ETL_VECTOR_FORCE_CPP03 0 - //***************************************************************************** ///\defgroup vector vector /// A vector with the capacity defined at compile time. @@ -430,7 +428,7 @@ namespace etl } #endif -#if ETL_CPP11_SUPPORTED && !defined(ETL_STLPORT) && !defined(ETL_NO_STL) && !ETL_VECTOR_FORCE_CPP03 +#if ETL_CPP11_SUPPORTED && !defined(ETL_STLPORT) && !defined(ETL_VECTOR_FORCE_CPP03) //********************************************************************* /// Constructs a value at the end of the vector. /// If asserts or exceptions are enabled, emits vector_full if the vector is already full. @@ -510,7 +508,7 @@ namespace etl ++p_end; ETL_INCREMENT_DEBUG_COUNT } -#endif // ETL_CPP11_SUPPORTED && !defined(ETL_STLPORT) && !defined(ETL_NO_STL) && !ETL_VECTOR_FORCE_CPP03 +#endif //************************************************************************* /// Removes an element from the end of the vector. @@ -577,7 +575,7 @@ namespace etl //************************************************************************* /// Emplaces a value to the vextor at the specified position. //************************************************************************* -#if ETL_CPP11_SUPPORTED && !defined(ETL_STLPORT) && !defined(ETL_NO_STL) +#if ETL_CPP11_SUPPORTED && !defined(ETL_STLPORT) template iterator emplace(iterator position, Args && ... args) { @@ -702,7 +700,7 @@ namespace etl return position; } -#endif // ETL_CPP11_SUPPORTED && !defined(ETL_STLPORT) && !defined(ETL_NO_STL) +#endif //********************************************************************* /// Inserts 'n' values to the vector. diff --git a/include/etl/version.h b/include/etl/version.h index 16e785a7..d717855e 100644 --- a/include/etl/version.h +++ b/include/etl/version.h @@ -38,8 +38,8 @@ SOFTWARE. ///\ingroup utilities #define ETL_VERSION_MAJOR 14 -#define ETL_VERSION_MINOR 11 -#define ETL_VERSION_PATCH 3 +#define ETL_VERSION_MINOR 12 +#define ETL_VERSION_PATCH 0 #define ETL_VERSION ETL_STRINGIFY(ETL_VERSION_MAJOR) ETL_STRINGIFY(ETL_VERSION_MINOR) ETL_STRINGIFY(ETL_VERSION_PATCH) #define ETL_VERSION_W ETL_WIDE_STRING(ETL_CONCAT(ETL_CONCAT(ETL_VERSION_MAJOR, ETL_VERSION_MINOR), ETL_VERSION_PATCH)) diff --git a/support/Release notes.txt b/support/Release notes.txt index beac40ef..e21a933b 100644 --- a/support/Release notes.txt +++ b/support/Release notes.txt @@ -1,3 +1,7 @@ +=============================================================================== +14.12.0 +Enabled emplace functions for C++03. + =============================================================================== 14.11.3 Moved C++03 force macros to test profile. diff --git a/test/etl_profile.h b/test/etl_profile.h index a53e5cee..02e0861a 100644 --- a/test/etl_profile.h +++ b/test/etl_profile.h @@ -76,11 +76,14 @@ SOFTWARE. //#define ETL_NO_STL -#define ETL_FUNCTION_FORCE_CPP03 0 -#define ETL_QUEUE_MPMC_MUTEX_FORCE_CPP03 0 -#define ETL_PRIORITY_QUEUE_FORCE_CPP03 0 -#define ETL_QUEUE_ATOMIC_FORCE_CPP03 0 -#define ETL_VARIANT_FORCE_CPP03 0 +//#define ETL_FUNCTION_FORCE_CPP03 +//#define ETL_PRIORITY_QUEUE_FORCE_CPP03 +//#define ETL_QUEUE_ATOMIC_FORCE_CPP03 +//#define ETL_VARIANT_FORCE_CPP03 +//#define ETL_VECTOR_FORCE_CPP03 +//#define ETL_QUEUE_FORCE_CPP03 +//#define ETL_QUEUE_MPMC_MUTEX_FORCE_CPP03 +//#define ETL_QUEUE_ISR_FORCE_CPP03 #ifdef _MSC_VER #include "etl/profiles/msvc_x86.h" diff --git a/test/test_vector_non_trivial.cpp b/test/test_vector_non_trivial.cpp index 530779f2..49ea3a33 100644 --- a/test/test_vector_non_trivial.cpp +++ b/test/test_vector_non_trivial.cpp @@ -800,7 +800,7 @@ namespace // So this is only tested on C++11 onwards TEST_FIXTURE(SetupFixture, test_emplace_back_non_const_references) { -#if ETL_CPP11_SUPPORTED && !defined(ETL_STLPORT) && !defined(ETL_NO_STL) && !ETL_VECTOR_FORCE_CPP03 +#if ETL_CPP11_SUPPORTED && !defined(ETL_STLPORT) && !defined(ETL_VECTOR_FORCE_CPP03) class Data { public: @@ -835,7 +835,7 @@ namespace compare_data.begin()); CHECK(is_equal); -#endif // ETL_CPP11_SUPPORTED && !defined(ETL_STLPORT) && !defined(ETL_NO_STL) +#endif } //*************************************************************************