From 87bf9ce76dfb039182fb74bfe8961a80ef91ca9e Mon Sep 17 00:00:00 2001 From: John Wellbelove Date: Fri, 12 Mar 2021 17:31:40 +0000 Subject: [PATCH] Updates to C++03 compatibility --- include/etl/array.h | 16 +- include/etl/basic_string.h | 8 +- include/etl/circular_buffer.h | 8 +- include/etl/deque.h | 9 +- include/etl/file_error_numbers.h | 1 + include/etl/flat_map.h | 2 +- include/etl/flat_multimap.h | 2 +- include/etl/flat_multiset.h | 2 +- include/etl/flat_set.h | 2 +- include/etl/forward_list.h | 8 +- include/etl/indirect_vector.h | 2 +- include/etl/intrusive_forward_list.h | 4 +- include/etl/intrusive_list.h | 4 +- include/etl/limits.h | 310 +++++++++--------- include/etl/list.h | 8 +- include/etl/map.h | 2 +- include/etl/memory.h | 3 +- include/etl/multimap.h | 2 +- include/etl/multiset.h | 2 +- include/etl/priority_queue.h | 2 +- include/etl/private/crc16_poly_0x1021_.h | 2 +- include/etl/private/crc16_poly_0x8005.h | 2 +- include/etl/private/crc32_poly_0x04c11db7.h | 2 +- include/etl/private/crc32_poly_0x1edc6f41.h | 2 +- .../private/crc64_poly_0x42f0e1eba9ea3693.h | 2 +- include/etl/private/minmax_pop.h | 10 +- include/etl/private/minmax_push.h | 2 + include/etl/reference_flat_map.h | 2 +- include/etl/reference_flat_multimap.h | 2 +- include/etl/reference_flat_set.h | 2 +- include/etl/set.h | 2 +- include/etl/string.h | 8 +- include/etl/string_view.h | 4 +- include/etl/u16string.h | 8 +- include/etl/u32string.h | 8 +- include/etl/unordered_map.h | 2 +- include/etl/unordered_multimap.h | 2 +- include/etl/unordered_multiset.h | 2 +- include/etl/unordered_set.h | 2 +- include/etl/vector.h | 16 +- include/etl/version.h | 2 +- include/etl/wstring.h | 8 +- library.json | 2 +- library.properties | 2 +- support/Release notes.txt | 6 + 45 files changed, 259 insertions(+), 240 deletions(-) diff --git a/include/etl/array.h b/include/etl/array.h index e48f83b1..6c6b35ef 100644 --- a/include/etl/array.h +++ b/include/etl/array.h @@ -139,7 +139,7 @@ namespace etl /// Returns a reference to the value at index 'i'. ///\param i The index of the element to access. //************************************************************************* - ETL_CONSTEXPR reference operator[](size_t i) + reference operator[](size_t i) { return _buffer[i]; } @@ -157,7 +157,7 @@ namespace etl //************************************************************************* /// Returns a reference to the first element. //************************************************************************* - ETL_CONSTEXPR reference front() + reference front() { return _buffer[0]; } @@ -173,7 +173,7 @@ namespace etl //************************************************************************* /// Returns a reference to the last element. //************************************************************************* - ETL_CONSTEXPR reference back() + reference back() { return _buffer[SIZE - 1]; } @@ -189,7 +189,7 @@ namespace etl //************************************************************************* /// Returns a pointer to the first element of the internal buffer. //************************************************************************* - ETL_CONSTEXPR pointer data() ETL_NOEXCEPT + pointer data() ETL_NOEXCEPT { return &_buffer[0]; } @@ -209,7 +209,7 @@ namespace etl //************************************************************************* /// Returns an iterator to the beginning of the array. //************************************************************************* - ETL_CONSTEXPR iterator begin() ETL_NOEXCEPT + iterator begin() ETL_NOEXCEPT { return &_buffer[0]; } @@ -233,7 +233,7 @@ namespace etl //************************************************************************* /// Returns an iterator to the end of the array. //************************************************************************* - ETL_CONSTEXPR iterator end() ETL_NOEXCEPT + iterator end() ETL_NOEXCEPT { return &_buffer[SIZE]; } @@ -257,7 +257,7 @@ namespace etl //************************************************************************* // Returns an reverse iterator to the reverse beginning of the array. //************************************************************************* - ETL_CONSTEXPR reverse_iterator rbegin() ETL_NOEXCEPT + reverse_iterator rbegin() ETL_NOEXCEPT { return reverse_iterator(end()); } @@ -281,7 +281,7 @@ namespace etl //************************************************************************* /// Returns a reverse iterator to the end of the array. //************************************************************************* - ETL_CONSTEXPR reverse_iterator rend() ETL_NOEXCEPT + reverse_iterator rend() ETL_NOEXCEPT { return reverse_iterator(begin()); } diff --git a/include/etl/basic_string.h b/include/etl/basic_string.h index 011d9f5c..1c45bd4a 100644 --- a/include/etl/basic_string.h +++ b/include/etl/basic_string.h @@ -92,7 +92,7 @@ namespace etl public: string_empty(string_type file_name_, numeric_type line_number_) - : string_exception(ETL_ERROR_TEXT("string:empty", ETL_STRING_FILE_ID"A"), file_name_, line_number_) + : string_exception(ETL_ERROR_TEXT("string:empty", ETL_BASIC_STRING_FILE_ID"A"), file_name_, line_number_) { } }; @@ -106,7 +106,7 @@ namespace etl public: string_out_of_bounds(string_type file_name_, numeric_type line_number_) - : string_exception(ETL_ERROR_TEXT("string:bounds", ETL_STRING_FILE_ID"B"), file_name_, line_number_) + : string_exception(ETL_ERROR_TEXT("string:bounds", ETL_BASIC_STRING_FILE_ID"B"), file_name_, line_number_) { } }; @@ -120,7 +120,7 @@ namespace etl public: string_iterator(string_type file_name_, numeric_type line_number_) - : string_exception(ETL_ERROR_TEXT("string:iterator", ETL_STRING_FILE_ID"C"), file_name_, line_number_) + : string_exception(ETL_ERROR_TEXT("string:iterator", ETL_BASIC_STRING_FILE_ID"C"), file_name_, line_number_) { } }; @@ -134,7 +134,7 @@ namespace etl public: string_truncation(string_type file_name_, numeric_type line_number_) - : string_exception(ETL_ERROR_TEXT("string:iterator", ETL_STRING_FILE_ID"D"), file_name_, line_number_) + : string_exception(ETL_ERROR_TEXT("string:iterator", ETL_BASIC_STRING_FILE_ID"D"), file_name_, line_number_) { } }; diff --git a/include/etl/circular_buffer.h b/include/etl/circular_buffer.h index ddf2d993..513ae868 100644 --- a/include/etl/circular_buffer.h +++ b/include/etl/circular_buffer.h @@ -1064,8 +1064,8 @@ namespace etl /// Constructor. /// Constructs a buffer from an iterator range. //************************************************************************* - template ::value, int>::type = 0> - circular_buffer(TIterator first, const TIterator& last) + template + circular_buffer(TIterator first, const TIterator& last, typename etl::enable_if::value, int>::type = 0) : icircular_buffer(reinterpret_cast(buffer.raw), MAX_SIZE) { while (first != last) @@ -1181,8 +1181,8 @@ namespace etl /// Constructor. /// Constructs a buffer from an iterator range. //************************************************************************* - template ::value, int>::type = 0> - circular_buffer_ext(TIterator first, const TIterator& last, void* buffer, size_t max_size) + template + circular_buffer_ext(TIterator first, const TIterator& last, void* buffer, size_t max_size, typename etl::enable_if::value, int>::type = 0) : icircular_buffer(reinterpret_cast(buffer), max_size) { while (first != last) diff --git a/include/etl/deque.h b/include/etl/deque.h index 7aa61a54..42ae771f 100644 --- a/include/etl/deque.h +++ b/include/etl/deque.h @@ -2380,8 +2380,8 @@ namespace etl //************************************************************************* /// Assigns data to the deque. //************************************************************************* - template ::value, int>::type = 0> - deque(TIterator begin_, TIterator end_) + template + deque(TIterator begin_, TIterator end_, typename etl::enable_if::value, int>::type = 0) : etl::ideque(reinterpret_cast(buffer.raw), MAX_SIZE, BUFFER_SIZE) { this->assign(begin_, end_); @@ -2444,7 +2444,10 @@ namespace etl //************************************************************************* /// Fix the internal pointers after a low level memory copy. //************************************************************************* - void repair() +#ifdef ETL_ISTRING_REPAIR_ENABLE + virtual +#endif + void repair() #ifdef ETL_ISTRING_REPAIR_ENABLE ETL_OVERRIDE #endif diff --git a/include/etl/file_error_numbers.h b/include/etl/file_error_numbers.h index 88c5280b..a72f34de 100644 --- a/include/etl/file_error_numbers.h +++ b/include/etl/file_error_numbers.h @@ -91,5 +91,6 @@ SOFTWARE. #define ETL_REFERENCE_COUNTER_MESSAGE_POOL_FILE_ID "58" #define ETL_QUEUE_SPSC_LOCKABLE_FILE_ID "59" #define ETL_MESSAGE_ROUTER_REGISTRY_FILE_ID "60" +#define ETL_ARRAY_WRAPPER_FILE_ID "61" #endif diff --git a/include/etl/flat_map.h b/include/etl/flat_map.h index 632a92ae..f6243742 100644 --- a/include/etl/flat_map.h +++ b/include/etl/flat_map.h @@ -936,7 +936,7 @@ namespace etl ///\param first The iterator to the first element. ///\param last The iterator to the last element + 1. //************************************************************************* - template ::value, int>::type = 0> + template flat_map(TIterator first, TIterator last) : etl::iflat_map(lookup, storage) { diff --git a/include/etl/flat_multimap.h b/include/etl/flat_multimap.h index 76450176..5b7edf1e 100644 --- a/include/etl/flat_multimap.h +++ b/include/etl/flat_multimap.h @@ -839,7 +839,7 @@ namespace etl ///\param first The iterator to the first element. ///\param last The iterator to the last element + 1. //************************************************************************* - template ::value, int>::type = 0> + template flat_multimap(TIterator first, TIterator last) : etl::iflat_multimap(lookup, storage) { diff --git a/include/etl/flat_multiset.h b/include/etl/flat_multiset.h index 846f4679..5833659b 100644 --- a/include/etl/flat_multiset.h +++ b/include/etl/flat_multiset.h @@ -791,7 +791,7 @@ namespace etl ///\param first The iterator to the first element. ///\param last The iterator to the last element + 1. //************************************************************************* - template ::value, int>::type = 0> + template flat_multiset(TIterator first, TIterator last) : iflat_multiset(lookup, storage) { diff --git a/include/etl/flat_set.h b/include/etl/flat_set.h index 95a646f9..690b191d 100644 --- a/include/etl/flat_set.h +++ b/include/etl/flat_set.h @@ -876,7 +876,7 @@ namespace etl ///\param first The iterator to the first element. ///\param last The iterator to the last element + 1. //************************************************************************* - template ::value, int>::type = 0> + template flat_set(TIterator first, TIterator last) : etl::iflat_set(lookup, storage) { diff --git a/include/etl/forward_list.h b/include/etl/forward_list.h index 9d7bf1ff..6cf66340 100644 --- a/include/etl/forward_list.h +++ b/include/etl/forward_list.h @@ -1673,8 +1673,8 @@ namespace etl //************************************************************************* /// Construct from range. //************************************************************************* - template ::value, int>::type = 0> - forward_list(TIterator first, TIterator last) + template + forward_list(TIterator first, TIterator last, typename etl::enable_if::value, int>::type = 0) : etl::iforward_list(node_pool, MAX_SIZE, false) { this->assign(first, last); @@ -1834,8 +1834,8 @@ namespace etl //************************************************************************* /// Construct from range. //************************************************************************* - template ::value, int>::type = 0> - forward_list_ext(TIterator first, TIterator last, etl::ipool& node_pool) + template + forward_list_ext(TIterator first, TIterator last, etl::ipool& node_pool, typename etl::enable_if::value, int>::type = 0) : etl::iforward_list(node_pool, node_pool.max_size(), true) { this->assign(first, last); diff --git a/include/etl/indirect_vector.h b/include/etl/indirect_vector.h index 87cf2802..97c2cb6b 100644 --- a/include/etl/indirect_vector.h +++ b/include/etl/indirect_vector.h @@ -65,7 +65,7 @@ namespace etl public: indirect_vector_buffer_missmatch(string_type file_name_, numeric_type line_number_) - : vector_exception(ETL_ERROR_TEXT("indirect_vector:buffer_missmatch", INDIRECT_VECTOR_FILE_ID"A"), file_name_, line_number_) + : vector_exception(ETL_ERROR_TEXT("indirect_vector:buffer_missmatch", ETL_INDIRECT_VECTOR_FILE_ID"A"), file_name_, line_number_) { } }; diff --git a/include/etl/intrusive_forward_list.h b/include/etl/intrusive_forward_list.h index 5090d719..501415ef 100644 --- a/include/etl/intrusive_forward_list.h +++ b/include/etl/intrusive_forward_list.h @@ -514,8 +514,8 @@ namespace etl //************************************************************************* /// Constructor from range //************************************************************************* - template ::value, int>::type = 0> - intrusive_forward_list(TIterator first, TIterator last) + template + intrusive_forward_list(TIterator first, TIterator last, typename etl::enable_if::value, int>::type = 0) { this->assign(first, last); } diff --git a/include/etl/intrusive_list.h b/include/etl/intrusive_list.h index 2ba28ba9..3c8df192 100644 --- a/include/etl/intrusive_list.h +++ b/include/etl/intrusive_list.h @@ -599,8 +599,8 @@ namespace etl //************************************************************************* /// Constructor from range //************************************************************************* - template ::value, int>::type = 0> - intrusive_list(TIterator first, TIterator last) + template + intrusive_list(TIterator first, TIterator last, typename etl::enable_if::value, int>::type = 0) { this->assign(first, last); } diff --git a/include/etl/limits.h b/include/etl/limits.h index 7bde2a3d..111bee0c 100644 --- a/include/etl/limits.h +++ b/include/etl/limits.h @@ -46,6 +46,8 @@ SOFTWARE. #include #include +#include "private/minmax_push.h" + #if defined(ETL_COMPILER_MICROSOFT) #pragma warning(push) #pragma warning(disable : 26812) @@ -196,15 +198,15 @@ namespace etl static ETL_CONSTANT bool is_signed = false; static ETL_CONSTANT bool is_modulo = false; - static ETL_CONSTANT bool min() { return false; } - static ETL_CONSTANT bool max() { return true; } - static ETL_CONSTANT bool lowest() { return false; } - static ETL_CONSTANT bool epsilon() { return false; } - static ETL_CONSTANT bool round_error() { return false; } - static ETL_CONSTANT bool denorm_min() { return false; } - static ETL_CONSTANT bool infinity() { return false; } - static ETL_CONSTANT bool quiet_NaN() { return false; } - static ETL_CONSTANT bool signaling_NaN() { return false; } + static ETL_CONSTEXPR bool min() { return false; } + static ETL_CONSTEXPR bool max() { return true; } + static ETL_CONSTEXPR bool lowest() { return false; } + static ETL_CONSTEXPR bool epsilon() { return false; } + static ETL_CONSTEXPR bool round_error() { return false; } + static ETL_CONSTEXPR bool denorm_min() { return false; } + static ETL_CONSTEXPR bool infinity() { return false; } + static ETL_CONSTEXPR bool quiet_NaN() { return false; } + static ETL_CONSTEXPR bool signaling_NaN() { return false; } }; //*************************************************************************** @@ -219,15 +221,15 @@ namespace etl static ETL_CONSTANT bool is_signed = etl::is_signed::value; static ETL_CONSTANT bool is_modulo = false; - static ETL_CONSTANT char min() { return char(CHAR_MIN); } - static ETL_CONSTANT char max() { return char(CHAR_MAX); } - static ETL_CONSTANT char lowest() { return char(CHAR_MIN); } - static ETL_CONSTANT char epsilon() { return 0; } - static ETL_CONSTANT char round_error() { return 0; } - static ETL_CONSTANT char denorm_min() { return 0; } - static ETL_CONSTANT char infinity() { return 0; } - static ETL_CONSTANT char quiet_NaN() { return 0; } - static ETL_CONSTANT char signaling_NaN() { return 0; } + static ETL_CONSTEXPR char min() { return char(CHAR_MIN); } + static ETL_CONSTEXPR char max() { return char(CHAR_MAX); } + static ETL_CONSTEXPR char lowest() { return char(CHAR_MIN); } + static ETL_CONSTEXPR char epsilon() { return 0; } + static ETL_CONSTEXPR char round_error() { return 0; } + static ETL_CONSTEXPR char denorm_min() { return 0; } + static ETL_CONSTEXPR char infinity() { return 0; } + static ETL_CONSTEXPR char quiet_NaN() { return 0; } + static ETL_CONSTEXPR char signaling_NaN() { return 0; } }; //*************************************************************************** @@ -242,15 +244,15 @@ namespace etl static ETL_CONSTANT bool is_signed = false; static ETL_CONSTANT bool is_modulo = true; - static ETL_CONSTANT unsigned char min() { return 0U; } - static ETL_CONSTANT unsigned char max() { return UCHAR_MAX; } - static ETL_CONSTANT unsigned char lowest() { return 0U; } - static ETL_CONSTANT unsigned char epsilon() { return 0U; } - static ETL_CONSTANT unsigned char round_error() { return 0U; } - static ETL_CONSTANT unsigned char denorm_min() { return 0U; } - static ETL_CONSTANT unsigned char infinity() { return 0U; } - static ETL_CONSTANT unsigned char quiet_NaN() { return 0U; } - static ETL_CONSTANT unsigned char signaling_NaN() { return 0U; } + static ETL_CONSTEXPR unsigned char min() { return 0U; } + static ETL_CONSTEXPR unsigned char max() { return UCHAR_MAX; } + static ETL_CONSTEXPR unsigned char lowest() { return 0U; } + static ETL_CONSTEXPR unsigned char epsilon() { return 0U; } + static ETL_CONSTEXPR unsigned char round_error() { return 0U; } + static ETL_CONSTEXPR unsigned char denorm_min() { return 0U; } + static ETL_CONSTEXPR unsigned char infinity() { return 0U; } + static ETL_CONSTEXPR unsigned char quiet_NaN() { return 0U; } + static ETL_CONSTEXPR unsigned char signaling_NaN() { return 0U; } }; //*************************************************************************** @@ -265,15 +267,15 @@ namespace etl static ETL_CONSTANT bool is_signed = true; static ETL_CONSTANT bool is_modulo = false; - static ETL_CONSTANT signed char min() { return SCHAR_MIN; } - static ETL_CONSTANT signed char max() { return SCHAR_MAX; } - static ETL_CONSTANT signed char lowest() { return SCHAR_MIN; } - static ETL_CONSTANT signed char epsilon() { return 0; } - static ETL_CONSTANT signed char round_error() { return 0; } - static ETL_CONSTANT signed char denorm_min() { return 0; } - static ETL_CONSTANT signed char infinity() { return 0; } - static ETL_CONSTANT signed char quiet_NaN() { return 0; } - static ETL_CONSTANT signed char signaling_NaN() { return 0; } + static ETL_CONSTEXPR signed char min() { return SCHAR_MIN; } + static ETL_CONSTEXPR signed char max() { return SCHAR_MAX; } + static ETL_CONSTEXPR signed char lowest() { return SCHAR_MIN; } + static ETL_CONSTEXPR signed char epsilon() { return 0; } + static ETL_CONSTEXPR signed char round_error() { return 0; } + static ETL_CONSTEXPR signed char denorm_min() { return 0; } + static ETL_CONSTEXPR signed char infinity() { return 0; } + static ETL_CONSTEXPR signed char quiet_NaN() { return 0; } + static ETL_CONSTEXPR signed char signaling_NaN() { return 0; } }; #if (ETL_NO_LARGE_CHAR_SUPPORT == false) @@ -289,15 +291,15 @@ namespace etl static ETL_CONSTANT bool is_signed = false; static ETL_CONSTANT bool is_modulo = true; - static ETL_CONSTANT char16_t min() { return 0U; } - static ETL_CONSTANT char16_t max() { return UINT_LEAST16_MAX; } - static ETL_CONSTANT char16_t lowest() { return 0U; } - static ETL_CONSTANT char16_t epsilon() { return 0U; } - static ETL_CONSTANT char16_t round_error() { return 0U; } - static ETL_CONSTANT char16_t denorm_min() { return 0U; } - static ETL_CONSTANT char16_t infinity() { return 0U; } - static ETL_CONSTANT char16_t quiet_NaN() { return 0U; } - static ETL_CONSTANT char16_t signaling_NaN() { return 0U; } + static ETL_CONSTEXPR char16_t min() { return 0U; } + static ETL_CONSTEXPR char16_t max() { return UINT_LEAST16_MAX; } + static ETL_CONSTEXPR char16_t lowest() { return 0U; } + static ETL_CONSTEXPR char16_t epsilon() { return 0U; } + static ETL_CONSTEXPR char16_t round_error() { return 0U; } + static ETL_CONSTEXPR char16_t denorm_min() { return 0U; } + static ETL_CONSTEXPR char16_t infinity() { return 0U; } + static ETL_CONSTEXPR char16_t quiet_NaN() { return 0U; } + static ETL_CONSTEXPR char16_t signaling_NaN() { return 0U; } }; //*************************************************************************** @@ -312,15 +314,15 @@ namespace etl static ETL_CONSTANT bool is_signed = false; static ETL_CONSTANT bool is_modulo = true; - static ETL_CONSTANT char32_t min() { return 0U; } - static ETL_CONSTANT char32_t max() { return UINT_LEAST32_MAX; } - static ETL_CONSTANT char32_t lowest() { return 0U; } - static ETL_CONSTANT char32_t epsilon() { return 0U; } - static ETL_CONSTANT char32_t round_error() { return 0U; } - static ETL_CONSTANT char32_t denorm_min() { return 0U; } - static ETL_CONSTANT char32_t infinity() { return 0U; } - static ETL_CONSTANT char32_t quiet_NaN() { return 0U; } - static ETL_CONSTANT char32_t signaling_NaN() { return 0U; } + static ETL_CONSTEXPR char32_t min() { return 0U; } + static ETL_CONSTEXPR char32_t max() { return UINT_LEAST32_MAX; } + static ETL_CONSTEXPR char32_t lowest() { return 0U; } + static ETL_CONSTEXPR char32_t epsilon() { return 0U; } + static ETL_CONSTEXPR char32_t round_error() { return 0U; } + static ETL_CONSTEXPR char32_t denorm_min() { return 0U; } + static ETL_CONSTEXPR char32_t infinity() { return 0U; } + static ETL_CONSTEXPR char32_t quiet_NaN() { return 0U; } + static ETL_CONSTEXPR char32_t signaling_NaN() { return 0U; } }; #endif @@ -337,15 +339,15 @@ namespace etl static ETL_CONSTANT bool is_signed = etl::is_signed::value; static ETL_CONSTANT bool is_modulo = etl::is_unsigned::value; - static ETL_CONSTANT wchar_t min() { return WCHAR_MIN; } - static ETL_CONSTANT wchar_t max() { return WCHAR_MAX; } - static ETL_CONSTANT wchar_t lowest() { return WCHAR_MIN; } - static ETL_CONSTANT wchar_t epsilon() { return wchar_t(0); } - static ETL_CONSTANT wchar_t round_error() { return wchar_t(0); } - static ETL_CONSTANT wchar_t denorm_min() { return wchar_t(0); } - static ETL_CONSTANT wchar_t infinity() { return wchar_t(0); } - static ETL_CONSTANT wchar_t quiet_NaN() { return wchar_t(0); } - static ETL_CONSTANT wchar_t signaling_NaN() { return wchar_t(0); } + static ETL_CONSTEXPR wchar_t min() { return WCHAR_MIN; } + static ETL_CONSTEXPR wchar_t max() { return WCHAR_MAX; } + static ETL_CONSTEXPR wchar_t lowest() { return WCHAR_MIN; } + static ETL_CONSTEXPR wchar_t epsilon() { return wchar_t(0); } + static ETL_CONSTEXPR wchar_t round_error() { return wchar_t(0); } + static ETL_CONSTEXPR wchar_t denorm_min() { return wchar_t(0); } + static ETL_CONSTEXPR wchar_t infinity() { return wchar_t(0); } + static ETL_CONSTEXPR wchar_t quiet_NaN() { return wchar_t(0); } + static ETL_CONSTEXPR wchar_t signaling_NaN() { return wchar_t(0); } }; //*************************************************************************** @@ -360,15 +362,15 @@ namespace etl static ETL_CONSTANT bool is_signed = true; static ETL_CONSTANT bool is_modulo = false; - static ETL_CONSTANT short min() { return SHRT_MIN; } - static ETL_CONSTANT short max() { return SHRT_MAX; } - static ETL_CONSTANT short lowest() { return SHRT_MIN; } - static ETL_CONSTANT short epsilon() { return 0; } - static ETL_CONSTANT short round_error() { return 0; } - static ETL_CONSTANT short denorm_min() { return 0; } - static ETL_CONSTANT short infinity() { return 0; } - static ETL_CONSTANT short quiet_NaN() { return 0; } - static ETL_CONSTANT short signaling_NaN() { return 0; } + static ETL_CONSTEXPR short min() { return SHRT_MIN; } + static ETL_CONSTEXPR short max() { return SHRT_MAX; } + static ETL_CONSTEXPR short lowest() { return SHRT_MIN; } + static ETL_CONSTEXPR short epsilon() { return 0; } + static ETL_CONSTEXPR short round_error() { return 0; } + static ETL_CONSTEXPR short denorm_min() { return 0; } + static ETL_CONSTEXPR short infinity() { return 0; } + static ETL_CONSTEXPR short quiet_NaN() { return 0; } + static ETL_CONSTEXPR short signaling_NaN() { return 0; } }; //*************************************************************************** @@ -383,15 +385,15 @@ namespace etl static ETL_CONSTANT bool is_signed = false; static ETL_CONSTANT bool is_modulo = true; - static ETL_CONSTANT unsigned short min() { return 0U; } - static ETL_CONSTANT unsigned short max() { return USHRT_MAX; } - static ETL_CONSTANT unsigned short lowest() { return 0U; } - static ETL_CONSTANT unsigned short epsilon() { return 0U; } - static ETL_CONSTANT unsigned short round_error() { return 0U; } - static ETL_CONSTANT unsigned short denorm_min() { return 0U; } - static ETL_CONSTANT unsigned short infinity() { return 0U; } - static ETL_CONSTANT unsigned short quiet_NaN() { return 0U; } - static ETL_CONSTANT unsigned short signaling_NaN() { return 0U; } + static ETL_CONSTEXPR unsigned short min() { return 0U; } + static ETL_CONSTEXPR unsigned short max() { return USHRT_MAX; } + static ETL_CONSTEXPR unsigned short lowest() { return 0U; } + static ETL_CONSTEXPR unsigned short epsilon() { return 0U; } + static ETL_CONSTEXPR unsigned short round_error() { return 0U; } + static ETL_CONSTEXPR unsigned short denorm_min() { return 0U; } + static ETL_CONSTEXPR unsigned short infinity() { return 0U; } + static ETL_CONSTEXPR unsigned short quiet_NaN() { return 0U; } + static ETL_CONSTEXPR unsigned short signaling_NaN() { return 0U; } }; @@ -407,15 +409,15 @@ namespace etl static ETL_CONSTANT bool is_signed = true; static ETL_CONSTANT bool is_modulo = false; - static ETL_CONSTANT int min() { return INT_MIN; } - static ETL_CONSTANT int max() { return INT_MAX; } - static ETL_CONSTANT int lowest() { return INT_MIN; } - static ETL_CONSTANT int epsilon() { return 0; } - static ETL_CONSTANT int round_error() { return 0; } - static ETL_CONSTANT int denorm_min() { return 0; } - static ETL_CONSTANT int infinity() { return 0; } - static ETL_CONSTANT int quiet_NaN() { return 0; } - static ETL_CONSTANT int signaling_NaN() { return 0; } + static ETL_CONSTEXPR int min() { return INT_MIN; } + static ETL_CONSTEXPR int max() { return INT_MAX; } + static ETL_CONSTEXPR int lowest() { return INT_MIN; } + static ETL_CONSTEXPR int epsilon() { return 0; } + static ETL_CONSTEXPR int round_error() { return 0; } + static ETL_CONSTEXPR int denorm_min() { return 0; } + static ETL_CONSTEXPR int infinity() { return 0; } + static ETL_CONSTEXPR int quiet_NaN() { return 0; } + static ETL_CONSTEXPR int signaling_NaN() { return 0; } }; //*************************************************************************** @@ -430,15 +432,15 @@ namespace etl static ETL_CONSTANT bool is_signed = false; static ETL_CONSTANT bool is_modulo = true; - static ETL_CONSTANT unsigned int min() { return 0U; } - static ETL_CONSTANT unsigned int max() { return UINT_MAX; } - static ETL_CONSTANT unsigned int lowest() { return 0U; } - static ETL_CONSTANT unsigned int epsilon() { return 0U; } - static ETL_CONSTANT unsigned int round_error() { return 0U; } - static ETL_CONSTANT unsigned int denorm_min() { return 0U; } - static ETL_CONSTANT unsigned int infinity() { return 0U; } - static ETL_CONSTANT unsigned int quiet_NaN() { return 0U; } - static ETL_CONSTANT unsigned int signaling_NaN() { return 0U; } + static ETL_CONSTEXPR unsigned int min() { return 0U; } + static ETL_CONSTEXPR unsigned int max() { return UINT_MAX; } + static ETL_CONSTEXPR unsigned int lowest() { return 0U; } + static ETL_CONSTEXPR unsigned int epsilon() { return 0U; } + static ETL_CONSTEXPR unsigned int round_error() { return 0U; } + static ETL_CONSTEXPR unsigned int denorm_min() { return 0U; } + static ETL_CONSTEXPR unsigned int infinity() { return 0U; } + static ETL_CONSTEXPR unsigned int quiet_NaN() { return 0U; } + static ETL_CONSTEXPR unsigned int signaling_NaN() { return 0U; } }; //*************************************************************************** @@ -453,15 +455,15 @@ namespace etl static ETL_CONSTANT bool is_signed = true; static ETL_CONSTANT bool is_modulo = false; - static ETL_CONSTANT long min() { return LONG_MIN; } - static ETL_CONSTANT long max() { return LONG_MAX; } - static ETL_CONSTANT long lowest() { return LONG_MIN; } - static ETL_CONSTANT long epsilon() { return 0; } - static ETL_CONSTANT long round_error() { return 0; } - static ETL_CONSTANT long denorm_min() { return 0; } - static ETL_CONSTANT long infinity() { return 0; } - static ETL_CONSTANT long quiet_NaN() { return 0; } - static ETL_CONSTANT long signaling_NaN() { return 0; } + static ETL_CONSTEXPR long min() { return LONG_MIN; } + static ETL_CONSTEXPR long max() { return LONG_MAX; } + static ETL_CONSTEXPR long lowest() { return LONG_MIN; } + static ETL_CONSTEXPR long epsilon() { return 0; } + static ETL_CONSTEXPR long round_error() { return 0; } + static ETL_CONSTEXPR long denorm_min() { return 0; } + static ETL_CONSTEXPR long infinity() { return 0; } + static ETL_CONSTEXPR long quiet_NaN() { return 0; } + static ETL_CONSTEXPR long signaling_NaN() { return 0; } }; //*************************************************************************** @@ -476,15 +478,15 @@ namespace etl static ETL_CONSTANT bool is_signed = false; static ETL_CONSTANT bool is_modulo = true; - static ETL_CONSTANT unsigned long min() { return 0U; } - static ETL_CONSTANT unsigned long max() { return ULONG_MAX; } - static ETL_CONSTANT unsigned long lowest() { return 0U; } - static ETL_CONSTANT unsigned long epsilon() { return 0U; } - static ETL_CONSTANT unsigned long round_error() { return 0U; } - static ETL_CONSTANT unsigned long denorm_min() { return 0U; } - static ETL_CONSTANT unsigned long infinity() { return 0U; } - static ETL_CONSTANT unsigned long quiet_NaN() { return 0U; } - static ETL_CONSTANT unsigned long signaling_NaN() { return 0U; } + static ETL_CONSTEXPR unsigned long min() { return 0U; } + static ETL_CONSTEXPR unsigned long max() { return ULONG_MAX; } + static ETL_CONSTEXPR unsigned long lowest() { return 0U; } + static ETL_CONSTEXPR unsigned long epsilon() { return 0U; } + static ETL_CONSTEXPR unsigned long round_error() { return 0U; } + static ETL_CONSTEXPR unsigned long denorm_min() { return 0U; } + static ETL_CONSTEXPR unsigned long infinity() { return 0U; } + static ETL_CONSTEXPR unsigned long quiet_NaN() { return 0U; } + static ETL_CONSTEXPR unsigned long signaling_NaN() { return 0U; } }; //*************************************************************************** @@ -499,15 +501,15 @@ namespace etl static ETL_CONSTANT bool is_signed = true; static ETL_CONSTANT bool is_modulo = false; - static ETL_CONSTANT long long min() { return LLONG_MIN; } - static ETL_CONSTANT long long max() { return LLONG_MAX; } - static ETL_CONSTANT long long lowest() { return LLONG_MIN; } - static ETL_CONSTANT long long epsilon() { return 0; } - static ETL_CONSTANT long long round_error() { return 0; } - static ETL_CONSTANT long long denorm_min() { return 0; } - static ETL_CONSTANT long long infinity() { return 0; } - static ETL_CONSTANT long long quiet_NaN() { return 0; } - static ETL_CONSTANT long long signaling_NaN() { return 0; } + static ETL_CONSTEXPR long long min() { return LLONG_MIN; } + static ETL_CONSTEXPR long long max() { return LLONG_MAX; } + static ETL_CONSTEXPR long long lowest() { return LLONG_MIN; } + static ETL_CONSTEXPR long long epsilon() { return 0; } + static ETL_CONSTEXPR long long round_error() { return 0; } + static ETL_CONSTEXPR long long denorm_min() { return 0; } + static ETL_CONSTEXPR long long infinity() { return 0; } + static ETL_CONSTEXPR long long quiet_NaN() { return 0; } + static ETL_CONSTEXPR long long signaling_NaN() { return 0; } }; //*************************************************************************** @@ -522,15 +524,15 @@ namespace etl static ETL_CONSTANT bool is_signed = false; static ETL_CONSTANT bool is_modulo = true; - static ETL_CONSTANT unsigned long long min() { return 0U; } - static ETL_CONSTANT unsigned long long max() { return ULLONG_MAX; } - static ETL_CONSTANT unsigned long long lowest() { return 0U; } - static ETL_CONSTANT unsigned long long epsilon() { return 0U; } - static ETL_CONSTANT unsigned long long round_error() { return 0U; } - static ETL_CONSTANT unsigned long long denorm_min() { return 0U; } - static ETL_CONSTANT unsigned long long infinity() { return 0U; } - static ETL_CONSTANT unsigned long long quiet_NaN() { return 0U; } - static ETL_CONSTANT unsigned long long signaling_NaN() { return 0U; } + static ETL_CONSTEXPR unsigned long long min() { return 0U; } + static ETL_CONSTEXPR unsigned long long max() { return ULLONG_MAX; } + static ETL_CONSTEXPR unsigned long long lowest() { return 0U; } + static ETL_CONSTEXPR unsigned long long epsilon() { return 0U; } + static ETL_CONSTEXPR unsigned long long round_error() { return 0U; } + static ETL_CONSTEXPR unsigned long long denorm_min() { return 0U; } + static ETL_CONSTEXPR unsigned long long infinity() { return 0U; } + static ETL_CONSTEXPR unsigned long long quiet_NaN() { return 0U; } + static ETL_CONSTEXPR unsigned long long signaling_NaN() { return 0U; } }; //*************************************************************************** @@ -540,12 +542,12 @@ namespace etl { public: - static ETL_CONSTANT float min() { return FLT_MIN; } - static ETL_CONSTANT float max() { return FLT_MAX; } - static ETL_CONSTANT float lowest() { return -FLT_MAX; } - static ETL_CONSTANT float epsilon() { return FLT_EPSILON; } - static ETL_CONSTANT float denorm_min() { return FLT_MIN; } - static ETL_CONSTANT float infinity() { return HUGE_VALF; } + static ETL_CONSTEXPR float min() { return FLT_MIN; } + static ETL_CONSTEXPR float max() { return FLT_MAX; } + static ETL_CONSTEXPR float lowest() { return -FLT_MAX; } + static ETL_CONSTEXPR float epsilon() { return FLT_EPSILON; } + static ETL_CONSTEXPR float denorm_min() { return FLT_MIN; } + static ETL_CONSTEXPR float infinity() { return HUGE_VALF; } static float quiet_NaN() { return ETL_NANF; } static float signaling_NaN() { return ETL_NANF; } @@ -566,12 +568,12 @@ namespace etl { public: - static ETL_CONSTANT double min() { return DBL_MIN; } - static ETL_CONSTANT double max() { return DBL_MAX; } - static ETL_CONSTANT double lowest() { return -DBL_MAX; } - static ETL_CONSTANT double epsilon() { return DBL_EPSILON; } - static ETL_CONSTANT double denorm_min() { return DBL_MIN; } - static ETL_CONSTANT double infinity() { return HUGE_VAL; } + static ETL_CONSTEXPR double min() { return DBL_MIN; } + static ETL_CONSTEXPR double max() { return DBL_MAX; } + static ETL_CONSTEXPR double lowest() { return -DBL_MAX; } + static ETL_CONSTEXPR double epsilon() { return DBL_EPSILON; } + static ETL_CONSTEXPR double denorm_min() { return DBL_MIN; } + static ETL_CONSTEXPR double infinity() { return HUGE_VAL; } static double quiet_NaN() { return ETL_NAN; } static double signaling_NaN() { return ETL_NAN; } @@ -592,12 +594,12 @@ namespace etl { public: - static ETL_CONSTANT long double min() { return LDBL_MIN; } - static ETL_CONSTANT long double max() { return LDBL_MAX; } - static ETL_CONSTANT long double lowest() { return -LDBL_MAX; } - static ETL_CONSTANT long double epsilon() { return LDBL_EPSILON; } - static ETL_CONSTANT long double denorm_min() { return LDBL_MIN; } - static ETL_CONSTANT long double infinity() { return HUGE_VALL; } + static ETL_CONSTEXPR long double min() { return LDBL_MIN; } + static ETL_CONSTEXPR long double max() { return LDBL_MAX; } + static ETL_CONSTEXPR long double lowest() { return -LDBL_MAX; } + static ETL_CONSTEXPR long double epsilon() { return LDBL_EPSILON; } + static ETL_CONSTEXPR long double denorm_min() { return LDBL_MIN; } + static ETL_CONSTEXPR long double infinity() { return HUGE_VALL; } static long double quiet_NaN() { return ETL_NANL; } static long double signaling_NaN() { return ETL_NANL; } @@ -645,4 +647,6 @@ namespace etl #pragma warning(pop) #endif +#include "private/minmax_pop.h" + #endif diff --git a/include/etl/list.h b/include/etl/list.h index c1d05fa1..3185c58d 100644 --- a/include/etl/list.h +++ b/include/etl/list.h @@ -2115,8 +2115,8 @@ namespace etl //************************************************************************* /// Construct from range. //************************************************************************* - template ::value, int>::type = 0> - list(TIterator first, TIterator last) + template + list(TIterator first, TIterator last, typename etl::enable_if::value, int>::type = 0) : ilist(node_pool, MAX_SIZE, false) { this->assign(first, last); @@ -2279,8 +2279,8 @@ namespace etl //************************************************************************* /// Construct from range. //************************************************************************* - template ::value, int>::type = 0> - list_ext(TIterator first, TIterator last, etl::ipool& node_pool) + template + list_ext(TIterator first, TIterator last, etl::ipool& node_pool, typename etl::enable_if::value, int>::type = 0) : ilist(node_pool, node_pool.max_size(), true) { this->assign(first, last); diff --git a/include/etl/map.h b/include/etl/map.h index 886dba2f..66f4af33 100644 --- a/include/etl/map.h +++ b/include/etl/map.h @@ -2223,7 +2223,7 @@ namespace etl ///\param first The iterator to the first element. ///\param last The iterator to the last element + 1. //************************************************************************* - template ::value, int>::type = 0> + template map(TIterator first, TIterator last) : etl::imap(node_pool, MAX_SIZE) { diff --git a/include/etl/memory.h b/include/etl/memory.h index 3ca01dac..0b793877 100644 --- a/include/etl/memory.h +++ b/include/etl/memory.h @@ -1542,9 +1542,8 @@ namespace etl unique_ptr(const unique_ptr&) ETL_DELETE; unique_ptr& operator =(const unique_ptr&) ETL_DELETE; + pointer p; TDeleter deleter; - - pointer p; }; } diff --git a/include/etl/multimap.h b/include/etl/multimap.h index 98dc09fc..e6816491 100644 --- a/include/etl/multimap.h +++ b/include/etl/multimap.h @@ -2085,7 +2085,7 @@ namespace etl ///\param first The iterator to the first element. ///\param last The iterator to the last element + 1. //************************************************************************* - template ::value, int>::type = 0> + template multimap(TIterator first, TIterator last) : etl::imultimap(node_pool, MAX_SIZE) { diff --git a/include/etl/multiset.h b/include/etl/multiset.h index 480c0f5f..f81bc172 100644 --- a/include/etl/multiset.h +++ b/include/etl/multiset.h @@ -2066,7 +2066,7 @@ namespace etl ///\param first The iterator to the first element. ///\param last The iterator to the last element + 1. //************************************************************************* - template ::value, int>::type = 0> + template multiset(TIterator first, TIterator last) : etl::imultiset(node_pool, MAX_SIZE) { diff --git a/include/etl/priority_queue.h b/include/etl/priority_queue.h index fbca8089..49db2f1c 100644 --- a/include/etl/priority_queue.h +++ b/include/etl/priority_queue.h @@ -455,7 +455,7 @@ namespace etl ///\param first The iterator to the first element. ///\param last The iterator to the last element + 1. //************************************************************************* - template ::value, int>::type = 0> + template priority_queue(TIterator first, TIterator last) : etl::ipriority_queue() { diff --git a/include/etl/private/crc16_poly_0x1021_.h b/include/etl/private/crc16_poly_0x1021_.h index 28da4f1a..85fc83d0 100644 --- a/include/etl/private/crc16_poly_0x1021_.h +++ b/include/etl/private/crc16_poly_0x1021_.h @@ -179,7 +179,7 @@ namespace etl /// \param begin Start of the range. /// \param end End of the range. //************************************************************************* - template::value, int>::type = 0> + template crc16_poly_0x1021(TIterator begin, const TIterator end) { this->reset(); diff --git a/include/etl/private/crc16_poly_0x8005.h b/include/etl/private/crc16_poly_0x8005.h index 129fa5f2..14526ff5 100644 --- a/include/etl/private/crc16_poly_0x8005.h +++ b/include/etl/private/crc16_poly_0x8005.h @@ -179,7 +179,7 @@ namespace etl /// \param begin Start of the range. /// \param end End of the range. //************************************************************************* - template::value, int>::type = 0> + template crc16_poly_0x8005(TIterator begin, const TIterator end) { this->reset(); diff --git a/include/etl/private/crc32_poly_0x04c11db7.h b/include/etl/private/crc32_poly_0x04c11db7.h index 57a1acd2..801e70e8 100644 --- a/include/etl/private/crc32_poly_0x04c11db7.h +++ b/include/etl/private/crc32_poly_0x04c11db7.h @@ -179,7 +179,7 @@ namespace etl /// \param begin Start of the range. /// \param end End of the range. //************************************************************************* - template::value, int>::type = 0> + template crc32_poly_0x04c11db7(TIterator begin, const TIterator end) { this->reset(); diff --git a/include/etl/private/crc32_poly_0x1edc6f41.h b/include/etl/private/crc32_poly_0x1edc6f41.h index eedbfbab..a1e9677c 100644 --- a/include/etl/private/crc32_poly_0x1edc6f41.h +++ b/include/etl/private/crc32_poly_0x1edc6f41.h @@ -179,7 +179,7 @@ namespace etl /// \param begin Start of the range. /// \param end End of the range. //************************************************************************* - template::value, int>::type = 0> + template crc32_poly_0x1edc6f41(TIterator begin, const TIterator end) { this->reset(); diff --git a/include/etl/private/crc64_poly_0x42f0e1eba9ea3693.h b/include/etl/private/crc64_poly_0x42f0e1eba9ea3693.h index 12345d21..1237c002 100644 --- a/include/etl/private/crc64_poly_0x42f0e1eba9ea3693.h +++ b/include/etl/private/crc64_poly_0x42f0e1eba9ea3693.h @@ -211,7 +211,7 @@ namespace etl /// \param begin Start of the range. /// \param end End of the range. //************************************************************************* - template::value, int>::type = 0> + template crc64_poly_0x42f0e1eba9ea3693(TIterator begin, const TIterator end) { this->reset(); diff --git a/include/etl/private/minmax_pop.h b/include/etl/private/minmax_pop.h index f7ee5c0e..b989d79c 100644 --- a/include/etl/private/minmax_pop.h +++ b/include/etl/private/minmax_pop.h @@ -32,7 +32,11 @@ SOFTWARE. * The header include guard has been intentionally omitted. * This file is intended to evaluated multiple times by design. */ - -#pragma pop_macro("min") -#pragma pop_macro("max") +#if !defined(ETL_COMPILER_ARM5) + #pragma pop_macro("min") + #pragma pop_macro("max") +#else + #define min(a,b) ((a)<(b)?(a):(b)) + #define max(a,b) ((a)<(b)?(b):(a)) +#endif diff --git a/include/etl/private/minmax_push.h b/include/etl/private/minmax_push.h index 465b6189..ee648aca 100644 --- a/include/etl/private/minmax_push.h +++ b/include/etl/private/minmax_push.h @@ -33,7 +33,9 @@ SOFTWARE. * This file is intended to evaluated multiple times by design. */ +#if !defined(ETL_COMPILER_ARM5) #pragma push_macro("min") #pragma push_macro("max") +#endif #undef min #undef max diff --git a/include/etl/reference_flat_map.h b/include/etl/reference_flat_map.h index 2dfd7a76..21845dc3 100644 --- a/include/etl/reference_flat_map.h +++ b/include/etl/reference_flat_map.h @@ -939,7 +939,7 @@ namespace etl ///\param first The iterator to the first element. ///\param last The iterator to the last element + 1. //************************************************************************* - template ::value, int>::type = 0> + template reference_flat_map(TIterator first, TIterator last) : ireference_flat_map(lookup) { diff --git a/include/etl/reference_flat_multimap.h b/include/etl/reference_flat_multimap.h index 0457f9f2..613c6bee 100644 --- a/include/etl/reference_flat_multimap.h +++ b/include/etl/reference_flat_multimap.h @@ -851,7 +851,7 @@ namespace etl ///\param first The iterator to the first element. ///\param last The iterator to the last element + 1. //************************************************************************* - template ::value, int>::type = 0> + template reference_flat_multimap(TIterator first, TIterator last) : ireference_flat_multimap(lookup) { diff --git a/include/etl/reference_flat_set.h b/include/etl/reference_flat_set.h index 6fd3588b..5896807d 100644 --- a/include/etl/reference_flat_set.h +++ b/include/etl/reference_flat_set.h @@ -816,7 +816,7 @@ namespace etl ///\param first The iterator to the first element. ///\param last The iterator to the last element + 1. //************************************************************************* - template ::value, int>::type = 0> + template reference_flat_set(TIterator first, TIterator last) : ireference_flat_set(lookup) { diff --git a/include/etl/set.h b/include/etl/set.h index 8192e05c..4166c5e5 100644 --- a/include/etl/set.h +++ b/include/etl/set.h @@ -2149,7 +2149,7 @@ namespace etl ///\param first The iterator to the first element. ///\param last The iterator to the last element + 1. //************************************************************************* - template ::value, int>::type = 0> + template set(TIterator first, TIterator last) : etl::iset(node_pool, MAX_SIZE) { diff --git a/include/etl/string.h b/include/etl/string.h index 7a427db1..bbdc13ca 100644 --- a/include/etl/string.h +++ b/include/etl/string.h @@ -147,8 +147,8 @@ namespace etl ///\param first The iterator to the first element. ///\param last The iterator to the last element + 1. //************************************************************************* - template ::value, int>::type = 0> - string(TIterator first, TIterator last) + template + string(TIterator first, TIterator last, typename etl::enable_if::value, int>::type = 0) : istring(reinterpret_cast(&buffer), MAX_SIZE) { this->assign(first, last); @@ -353,8 +353,8 @@ namespace etl ///\param first The iterator to the first element. ///\param last The iterator to the last element + 1. //************************************************************************* - template ::value, int>::type = 0> - string_ext(TIterator first, TIterator last, value_type* buffer, size_type buffer_size) + template + string_ext(TIterator first, TIterator last, value_type* buffer, size_type buffer_size, typename etl::enable_if::value, int>::type = 0) : istring(buffer, buffer_size - 1U) { this->assign(first, last); diff --git a/include/etl/string_view.h b/include/etl/string_view.h index f49f49c4..fa894280 100644 --- a/include/etl/string_view.h +++ b/include/etl/string_view.h @@ -305,8 +305,8 @@ namespace etl //************************************************************************* /// Assign from iterators //************************************************************************* - template ::value, int>::type = 0> - void assign(TIterator begin_, TIterator end_) + template + void assign(TIterator begin_, TIterator end_, typename etl::enable_if::value, int>::type = 0) { mbegin = etl::addressof(*begin_); mend = etl::addressof(*begin_) + etl::distance(begin_, end_); diff --git a/include/etl/u16string.h b/include/etl/u16string.h index bde90b3e..4e9e1760 100644 --- a/include/etl/u16string.h +++ b/include/etl/u16string.h @@ -145,8 +145,8 @@ namespace etl ///\param first The iterator to the first element. ///\param last The iterator to the last element + 1. //************************************************************************* - template ::value, int>::type = 0> - u16string(TIterator first, TIterator last) + template + u16string(TIterator first, TIterator last, typename etl::enable_if::value, int>::type = 0) : iu16string(reinterpret_cast(&buffer), MAX_SIZE) { this->assign(first, last); @@ -336,8 +336,8 @@ namespace etl ///\param first The iterator to the first element. ///\param last The iterator to the last element + 1. //************************************************************************* - template ::value, int>::type = 0> - u16string_ext(TIterator first, TIterator last, value_type* buffer, size_type buffer_size) + template + u16string_ext(TIterator first, TIterator last, value_type* buffer, size_type buffer_size, typename etl::enable_if::value, int>::type = 0) : iu16string(buffer, buffer_size - 1U) { this->assign(first, last); diff --git a/include/etl/u32string.h b/include/etl/u32string.h index 43700cfb..7c621887 100644 --- a/include/etl/u32string.h +++ b/include/etl/u32string.h @@ -145,8 +145,8 @@ namespace etl ///\param first The iterator to the first element. ///\param last The iterator to the last element + 1. //************************************************************************* - template ::value, int>::type = 0> - u32string(TIterator first, TIterator last) + template + u32string(TIterator first, TIterator last, typename etl::enable_if::value, int>::type = 0) : iu32string(reinterpret_cast(&buffer), MAX_SIZE) { this->assign(first, last); @@ -336,8 +336,8 @@ namespace etl ///\param first The iterator to the first element. ///\param last The iterator to the last element + 1. //************************************************************************* - template ::value, int>::type = 0> - u32string_ext(TIterator first, TIterator last, value_type* buffer, size_type buffer_size) + template + u32string_ext(TIterator first, TIterator last, value_type* buffer, size_type buffer_size, typename etl::enable_if::value, int>::type = 0) : iu32string(buffer, buffer_size - 1U) { this->assign(first, last); diff --git a/include/etl/unordered_map.h b/include/etl/unordered_map.h index cb9db2ec..35ced3bc 100644 --- a/include/etl/unordered_map.h +++ b/include/etl/unordered_map.h @@ -1581,7 +1581,7 @@ namespace etl ///\param first The iterator to the first element. ///\param last The iterator to the last element + 1. //************************************************************************* - template ::value, int>::type = 0> + template unordered_map(TIterator first_, TIterator last_) : base(node_pool, buckets, MAX_BUCKETS_) { diff --git a/include/etl/unordered_multimap.h b/include/etl/unordered_multimap.h index 2398a5f7..4854d56e 100644 --- a/include/etl/unordered_multimap.h +++ b/include/etl/unordered_multimap.h @@ -1492,7 +1492,7 @@ namespace etl ///\param first The iterator to the first element. ///\param last The iterator to the last element + 1. //************************************************************************* - template ::value, int>::type = 0> + template unordered_multimap(TIterator first_, TIterator last_) : base(node_pool, buckets, MAX_BUCKETS) { diff --git a/include/etl/unordered_multiset.h b/include/etl/unordered_multiset.h index 9a3344e5..fcf7551f 100644 --- a/include/etl/unordered_multiset.h +++ b/include/etl/unordered_multiset.h @@ -1478,7 +1478,7 @@ namespace etl ///\param first The iterator to the first element. ///\param last The iterator to the last element + 1. //************************************************************************* - template ::value, int>::type = 0> + template unordered_multiset(TIterator first_, TIterator last_) : base(node_pool, buckets, MAX_BUCKETS) { diff --git a/include/etl/unordered_set.h b/include/etl/unordered_set.h index acebe209..1552d067 100644 --- a/include/etl/unordered_set.h +++ b/include/etl/unordered_set.h @@ -1476,7 +1476,7 @@ namespace etl ///\param first The iterator to the first element. ///\param last The iterator to the last element + 1. //************************************************************************* - template ::value, int>::type = 0> + template unordered_set(TIterator first_, TIterator last_) : base(node_pool, buckets, MAX_BUCKETS) { diff --git a/include/etl/vector.h b/include/etl/vector.h index fcc3ef4f..780f1ecb 100644 --- a/include/etl/vector.h +++ b/include/etl/vector.h @@ -1193,8 +1193,8 @@ namespace etl ///\param first The iterator to the first element. ///\param last The iterator to the last element + 1. //************************************************************************* - template ::value, int>::type = 0> - vector(TIterator first, TIterator last) + template + vector(TIterator first, TIterator last, typename etl::enable_if::value, int>::type = 0) : etl::ivector(reinterpret_cast(&buffer), MAX_SIZE) { this->assign(first, last); @@ -1366,8 +1366,8 @@ namespace etl ///\param first The iterator to the first element. ///\param last The iterator to the last element + 1. //************************************************************************* - template ::value, int>::type = 0> - vector_ext(TIterator first, TIterator last, void* buffer, size_t max_size) + template + vector_ext(TIterator first, TIterator last, void* buffer, size_t max_size, typename etl::enable_if::value, int>::type = 0) : etl::ivector(reinterpret_cast(buffer), max_size) { this->assign(first, last); @@ -1528,8 +1528,8 @@ namespace etl ///\param first The iterator to the first element. ///\param last The iterator to the last element + 1. //************************************************************************* - template ::value, int>::type = 0> - vector(TIterator first, TIterator last) + template + vector(TIterator first, TIterator last, typename etl::enable_if::value, int>::type = 0) : etl::ivector(reinterpret_cast(&buffer), MAX_SIZE) { this->assign(first, last); @@ -1660,8 +1660,8 @@ namespace etl ///\param first The iterator to the first element. ///\param last The iterator to the last element + 1. //************************************************************************* - template ::value, int>::type = 0> - vector_ext(TIterator first, TIterator last, void* buffer, size_t max_size) + template + vector_ext(TIterator first, TIterator last, void* buffer, size_t max_size, typename etl::enable_if::value, int>::type = 0) : etl::ivector(reinterpret_cast(buffer), max_size) { this->assign(first, last); diff --git a/include/etl/version.h b/include/etl/version.h index b1ef9714..0641342e 100644 --- a/include/etl/version.h +++ b/include/etl/version.h @@ -39,7 +39,7 @@ SOFTWARE. #define ETL_VERSION_MAJOR 20 #define ETL_VERSION_MINOR 6 -#define ETL_VERSION_PATCH 0 +#define ETL_VERSION_PATCH 1 #define ETL_VERSION ETL_STRINGIFY(ETL_VERSION_MAJOR) "." ETL_STRINGIFY(ETL_VERSION_MINOR) "." ETL_STRINGIFY(ETL_VERSION_PATCH) #define ETL_VERSION_W ETL_STRINGIFY(ETL_VERSION_MAJOR) L"." ETL_STRINGIFY(ETL_VERSION_MINOR) L"." ETL_STRINGIFY(ETL_VERSION_PATCH) #define ETL_VERSION_U16 ETL_STRINGIFY(ETL_VERSION_MAJOR) u"." ETL_STRINGIFY(ETL_VERSION_MINOR) u"." ETL_STRINGIFY(ETL_VERSION_PATCH) diff --git a/include/etl/wstring.h b/include/etl/wstring.h index fb008655..2e8c91fb 100644 --- a/include/etl/wstring.h +++ b/include/etl/wstring.h @@ -145,8 +145,8 @@ namespace etl ///\param first The iterator to the first element. ///\param last The iterator to the last element + 1. //************************************************************************* - template ::value, int>::type = 0> - wstring(TIterator first, TIterator last) + template + wstring(TIterator first, TIterator last, typename etl::enable_if::value, int>::type = 0) : iwstring(reinterpret_cast(&buffer), MAX_SIZE) { this->assign(first, last); @@ -336,8 +336,8 @@ namespace etl ///\param first The iterator to the first element. ///\param last The iterator to the last element + 1. //************************************************************************* - template ::value, int>::type = 0> - wstring_ext(TIterator first, TIterator last, value_type* buffer, size_type buffer_size) + template + wstring_ext(TIterator first, TIterator last, value_type* buffer, size_type buffer_size, typename etl::enable_if::value, int>::type = 0) : iwstring(buffer, buffer_size - 1U) { this->assign(first, last); diff --git a/library.json b/library.json index 1297047f..477c01b6 100644 --- a/library.json +++ b/library.json @@ -1,6 +1,6 @@ { "name": "ETL Embedded Template Library", - "version": "20.6.0", + "version": "20.6.1", "author s": { "name": "John Wellbelove", "email": "john.wellbelove@etlcpp.com" diff --git a/library.properties b/library.properties index e3ae4d6b..8174af72 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=Embedded Template Library ETL -version=20.6.0 +version=20.6.1 author= John Wellbelove maintainer=John Wellbelove license=MIT diff --git a/support/Release notes.txt b/support/Release notes.txt index 2ed84a1b..e75582a8 100644 --- a/support/Release notes.txt +++ b/support/Release notes.txt @@ -1,3 +1,9 @@ +=============================================================================== +20.6.1 +Added missing etl::atomic from gcc & clang implementations. +Changed nullptr to ETL_NULLPTR in buffer_descriptors and multi_range. +Fixed header includes in state_chart.h + =============================================================================== 20.6.0 Added etl::message_router_registry.