diff --git a/include/etl/algorithm.h b/include/etl/algorithm.h index 626ca838..50059cd3 100644 --- a/include/etl/algorithm.h +++ b/include/etl/algorithm.h @@ -5,7 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl -http://www.etlcpp.com +https://www.etlcpp.com Copyright(c) 2014 jwellbelove @@ -56,7 +56,7 @@ namespace etl //*************************************************************************** template - std::pair minmax_element(TIterator begin, + ETLSTD::pair minmax_element(TIterator begin, TIterator end, TCompare compare) { @@ -78,7 +78,7 @@ namespace etl ++begin; } - return std::pair(minimum, maximum); + return ETLSTD::pair(minimum, maximum); } //*************************************************************************** @@ -87,12 +87,12 @@ namespace etl /// //*************************************************************************** template - std::pair minmax_element(TIterator begin, + ETLSTD::pair minmax_element(TIterator begin, TIterator end) { - typedef typename std::iterator_traits::value_type value_t; + typedef typename ETLSTD::iterator_traits::value_type value_t; - return etl::minmax_element(begin, end, std::less()); + return etl::minmax_element(begin, end, ETLSTD::less()); } //*************************************************************************** @@ -101,10 +101,10 @@ namespace etl /// //*************************************************************************** template - std::pair minmax(const T& a, + ETLSTD::pair minmax(const T& a, const T& b) { - return (b < a) ? std::pair(b, a) : std::pair(a, b); + return (b < a) ? ETLSTD::pair(b, a) : ETLSTD::pair(a, b); } //*************************************************************************** @@ -114,11 +114,11 @@ namespace etl //*************************************************************************** template - std::pair minmax(const T& a, + ETLSTD::pair minmax(const T& a, const T& b, TCompare compare) { - return compare(b, a) ? std::pair(b, a) : std::pair(a, b); + return compare(b, a) ? ETLSTD::pair(b, a) : ETLSTD::pair(a, b); } //*************************************************************************** @@ -223,11 +223,11 @@ namespace etl TOutputIterator o_begin, TOutputIterator o_end) { - size_t s_size = std::distance(i_begin, i_end); - size_t d_size = std::distance(o_begin, o_end); + size_t s_size = ETLSTD::distance(i_begin, i_end); + size_t d_size = ETLSTD::distance(o_begin, o_end); size_t size = (s_size < d_size) ? s_size : d_size; - return std::copy(i_begin, i_begin + size, o_begin); + return ETLSTD::copy(i_begin, i_begin + size, o_begin); } //*************************************************************************** @@ -271,7 +271,7 @@ namespace etl TSize n, TOutputIterator o_begin) { - return std::copy(i_begin, i_begin + n, o_begin); + return ETLSTD::copy(i_begin, i_begin + n, o_begin); } //*************************************************************************** @@ -430,7 +430,7 @@ namespace etl TIterator end, const TValue& value) { - TIterator it = std::lower_bound(begin, end, value); + TIterator it = ETLSTD::lower_bound(begin, end, value); if ((it == end) || (*it != value)) { @@ -455,7 +455,7 @@ namespace etl TBinaryPredicate predicate, TBinaryEquality equality) { - TIterator it = std::lower_bound(begin, end, value, predicate); + TIterator it = ETLSTD::lower_bound(begin, end, value, predicate); if ((it == end) || !equality(*it, value)) { @@ -514,7 +514,7 @@ namespace etl TIterator end, TUnaryPredicate predicate) { - return std::find_if(begin, end, predicate) != end; + return ETLSTD::find_if(begin, end, predicate) != end; } //*************************************************************************** @@ -528,7 +528,7 @@ namespace etl TIterator end, TUnaryPredicate predicate) { - return std::find_if(begin, end, predicate) == end; + return ETLSTD::find_if(begin, end, predicate) == end; } //*************************************************************************** @@ -546,15 +546,15 @@ namespace etl { TIterator2 end2 = begin2; - std::advance(end2, std::distance(begin1, end1)); + ETLSTD::advance(end2, ETLSTD::distance(begin1, end1)); for (TIterator1 i = begin1; i != end1; ++i) { - if (i == std::find(begin1, i, *i)) + if (i == ETLSTD::find(begin1, i, *i)) { - size_t n = std::count(begin2, end2, *i); + size_t n = ETLSTD::count(begin2, end2, *i); - if (n == 0 || size_t(std::count(i, end1, *i)) != n) + if (n == 0 || size_t(ETLSTD::count(i, end1, *i)) != n) { return false; } @@ -581,11 +581,11 @@ namespace etl { for (TIterator1 i = begin1; i != end1; ++i) { - if (i == std::find(begin1, i, *i)) + if (i == ETLSTD::find(begin1, i, *i)) { - size_t n = std::count(begin2, end2, *i); + size_t n = ETLSTD::count(begin2, end2, *i); - if (n == 0 || size_t(std::count(i, end1, *i)) != n) + if (n == 0 || size_t(ETLSTD::count(i, end1, *i)) != n) { return false; } @@ -613,19 +613,19 @@ namespace etl { TIterator2 end2 = begin2; - std::advance(end2, std::distance(begin1, end1)); + ETLSTD::advance(end2, ETLSTD::distance(begin1, end1)); for (TIterator1 i = begin1; i != end1; ++i) { #if ETL_CPP11_SUPPORTED && !defined(ETL_NO_STL) - if (i == std::find_if(begin1, i, std::bind(predicate, *i, std::placeholders::_1))) + if (i == ETLSTD::find_if(begin1, i, ETLSTD::bind(predicate, *i, ETLSTD::placeholders::_1))) #else - if (i == std::find_if(begin1, i, std::bind1st(predicate, *i))) + if (i == ETLSTD::find_if(begin1, i, ETLSTD::bind1st(predicate, *i))) #endif { - size_t n = std::count(begin2, end2, *i); + size_t n = ETLSTD::count(begin2, end2, *i); - if (n == 0 || size_t(std::count(i, end1, *i)) != n) + if (n == 0 || size_t(ETLSTD::count(i, end1, *i)) != n) { return false; } @@ -655,14 +655,14 @@ namespace etl for (TIterator1 i = begin1; i != end1; ++i) { #if ETL_CPP11_SUPPORTED && !defined(ETL_NO_STL) - if (i == std::find_if(begin1, i, std::bind(predicate, *i, std::placeholders::_1))) + if (i == ETLSTD::find_if(begin1, i, ETLSTD::bind(predicate, *i, ETLSTD::placeholders::_1))) #else - if (i == std::find_if(begin1, i, std::bind1st(predicate, *i))) + if (i == ETLSTD::find_if(begin1, i, ETLSTD::bind1st(predicate, *i))) #endif { - size_t n = std::count(begin2, end2, *i); + size_t n = ETLSTD::count(begin2, end2, *i); - if (n == 0 || size_t(std::count(i, end1, *i)) != n) + if (n == 0 || size_t(ETLSTD::count(i, end1, *i)) != n) { return false; } @@ -737,7 +737,7 @@ namespace etl typename TDestinationTrue, typename TDestinationFalse, typename TUnaryPredicate> - std::pair partition_copy(TSource begin, + ETLSTD::pair partition_copy(TSource begin, TSource end, TDestinationTrue destination_true, TDestinationFalse destination_false, @@ -755,11 +755,11 @@ namespace etl } } - return std::pair(destination_true, destination_false); + return ETLSTD::pair(destination_true, destination_false); } //*************************************************************************** - /// Like std::for_each but applies a predicate before calling the function. + /// Like ETLSTD::for_each but applies a predicate before calling the function. ///\ingroup algorithm //*************************************************************************** template - std::pair partition_transform(TSource begin, + ETLSTD::pair partition_transform(TSource begin, TSource end, TDestinationTrue destination_true, TDestinationFalse destination_false, @@ -1083,7 +1083,7 @@ namespace etl } } - return std::pair(destination_true, destination_false); + return ETLSTD::pair(destination_true, destination_false); } //*************************************************************************** @@ -1098,7 +1098,7 @@ namespace etl typename TBinaryFunctionTrue, typename TBinaryFunctionFalse, typename TBinaryPredicate> - std::pair partition_transform(TSource1 begin1, + ETLSTD::pair partition_transform(TSource1 begin1, TSource1 end1, TSource2 begin2, TDestinationTrue destination_true, @@ -1119,7 +1119,7 @@ namespace etl } } - return std::pair(destination_true, destination_false); + return ETLSTD::pair(destination_true, destination_false); } //*************************************************************************** @@ -1130,9 +1130,9 @@ namespace etl template void sort(TIterator first, TIterator last, TCompare compare) { - typedef typename std::iterator_traits::difference_type difference_t; + typedef typename ETLSTD::iterator_traits::difference_type difference_t; - difference_t n = std::distance(first, last); + difference_t n = ETLSTD::distance(first, last); for (difference_t i = n / 2; i > 0; i /= 2) { @@ -1143,12 +1143,12 @@ namespace etl TIterator itr1 = first; TIterator itr2 = first; - std::advance(itr1, k); - std::advance(itr2, k + i); + ETLSTD::advance(itr1, k); + ETLSTD::advance(itr2, k + i); if (compare(*itr2, *itr1)) { - std::iter_swap(itr1, itr2); + ETLSTD::iter_swap(itr1, itr2); } } } @@ -1162,7 +1162,7 @@ namespace etl template void sort(TIterator first, TIterator last) { - etl::sort(first, last, std::less::value_type>()); + etl::sort(first, last, ETLSTD::less::value_type>()); } #if ETL_CPP11_SUPPORTED diff --git a/include/etl/alignment.h b/include/etl/alignment.h index e7f1bb9d..8b308cb6 100644 --- a/include/etl/alignment.h +++ b/include/etl/alignment.h @@ -5,7 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl -http://www.etlcpp.com +https://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/include/etl/array.h b/include/etl/array.h index 2c0e854d..8f360de5 100644 --- a/include/etl/array.h +++ b/include/etl/array.h @@ -107,8 +107,8 @@ namespace etl typedef const T* const_pointer; typedef T* iterator; typedef const T* const_iterator; - typedef std::reverse_iterator reverse_iterator; - typedef std::reverse_iterator const_reverse_iterator; + typedef ETLSTD::reverse_iterator reverse_iterator; + typedef ETLSTD::reverse_iterator const_reverse_iterator; //************************************************************************* // Element access diff --git a/include/etl/array_view.h b/include/etl/array_view.h index 52f99a4c..f27a3f87 100644 --- a/include/etl/array_view.h +++ b/include/etl/array_view.h @@ -108,8 +108,8 @@ namespace etl typedef const T* const_pointer; typedef T* iterator; typedef const T* const_iterator; - typedef std::reverse_iterator reverse_iterator; - typedef std::reverse_iterator const_reverse_iterator; + typedef ETLSTD::reverse_iterator reverse_iterator; + typedef ETLSTD::reverse_iterator const_reverse_iterator; //************************************************************************* /// Default constructor. diff --git a/include/etl/array_wrapper.h b/include/etl/array_wrapper.h index caf73404..86b0aa82 100644 --- a/include/etl/array_wrapper.h +++ b/include/etl/array_wrapper.h @@ -86,15 +86,15 @@ namespace etl public: typedef T value_type; - typedef size_t size_type; + typedef size_t size_type; typedef T& reference; typedef const T& const_reference; typedef T* pointer; typedef const T* const_pointer; typedef T* iterator; typedef const T* const_iterator; - typedef std::reverse_iterator reverse_iterator; - typedef std::reverse_iterator const_reverse_iterator; + typedef ETLSTD::reverse_iterator reverse_iterator; + typedef ETLSTD::reverse_iterator const_reverse_iterator; typedef typename etl::parameter_type::type parameter_t; diff --git a/include/etl/basic_string.h b/include/etl/basic_string.h index 0ae0bc5a..68f38074 100644 --- a/include/etl/basic_string.h +++ b/include/etl/basic_string.h @@ -5,7 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl -http://www.etlcpp.com +https://www.etlcpp.com Copyright(c) 2016 jwellbelove @@ -291,11 +291,11 @@ namespace etl typedef const T* const_pointer; typedef T* iterator; typedef const T* const_iterator; - typedef std::reverse_iterator reverse_iterator; - typedef std::reverse_iterator const_reverse_iterator; + typedef ETLSTD::reverse_iterator reverse_iterator; + typedef ETLSTD::reverse_iterator const_reverse_iterator; typedef size_t size_type; - typedef typename std::iterator_traits::difference_type difference_type; + typedef typename ETLSTD::iterator_traits::difference_type difference_type; //********************************************************************* /// Returns an iterator to the beginning of the string. @@ -427,12 +427,12 @@ namespace etl is_truncated = true; } - new_size = std::min(new_size, CAPACITY); + new_size = ETLSTD::min(new_size, CAPACITY); // Size up? if (new_size > current_size) { - std::fill(p_buffer + current_size, p_buffer + new_size, value); + ETLSTD::fill(p_buffer + current_size, p_buffer + new_size, value); } current_size = new_size; @@ -605,7 +605,7 @@ namespace etl is_truncated = (length_ > CAPACITY); - length_ = std::min(length_, CAPACITY); + length_ = ETLSTD::min(length_, CAPACITY); etl::copy_n(other, length_, begin()); @@ -624,7 +624,7 @@ namespace etl void assign(TIterator first, TIterator last) { #if defined(ETL_DEBUG) - difference_type d = std::distance(first, last); + difference_type d = ETLSTD::distance(first, last); ETL_ASSERT(d >= 0, ETL_ERROR(string_iterator)); #endif @@ -652,9 +652,9 @@ namespace etl is_truncated = (n > CAPACITY); - n = std::min(n, CAPACITY); + n = ETLSTD::min(n, CAPACITY); - std::fill_n(begin(), n, value); + ETLSTD::fill_n(begin(), n, value); current_size = n; p_buffer[current_size] = 0; } @@ -789,7 +789,7 @@ namespace etl { // Insert in the middle. ++current_size; - std::copy_backward(insert_position, end() - 1, end()); + ETLSTD::copy_backward(insert_position, end() - 1, end()); *insert_position = value; } else @@ -805,7 +805,7 @@ namespace etl if (position != end()) { // Insert in the middle. - std::copy_backward(insert_position, end() - 1, end()); + ETLSTD::copy_backward(insert_position, end() - 1, end()); *insert_position = value; } @@ -832,7 +832,7 @@ namespace etl // Quick hack, as iterators are pointers. iterator insert_position = const_cast(position); - const size_t start = std::distance(cbegin(), position); + const size_t start = ETLSTD::distance(cbegin(), position); // No effect. if (start >= CAPACITY) @@ -850,7 +850,7 @@ namespace etl } current_size = CAPACITY; - std::fill(insert_position, end(), value); + ETLSTD::fill(insert_position, end(), value); } else { @@ -859,7 +859,7 @@ namespace etl const size_t to_position = start + shift_amount; const size_t remaining_characters = current_size - start; const size_t max_shift_characters = CAPACITY - start - shift_amount; - const size_t characters_to_shift = std::min(max_shift_characters, remaining_characters); + const size_t characters_to_shift = ETLSTD::min(max_shift_characters, remaining_characters); // Will the string truncate? if ((start + shift_amount + remaining_characters) > CAPACITY) @@ -872,8 +872,8 @@ namespace etl current_size += shift_amount; } - std::copy_backward(insert_position, insert_position + characters_to_shift, begin() + to_position + characters_to_shift); - std::fill(insert_position, insert_position + shift_amount, value); + ETLSTD::copy_backward(insert_position, insert_position + characters_to_shift, begin() + to_position + characters_to_shift); + ETLSTD::fill(insert_position, insert_position + shift_amount, value); } p_buffer[current_size] = 0; @@ -894,8 +894,8 @@ namespace etl return; } - const size_t start = std::distance(begin(), position); - const size_t n = std::distance(first, last); + const size_t start = ETLSTD::distance(begin(), position); + const size_t n = ETLSTD::distance(first, last); // No effect. if (start >= CAPACITY) @@ -926,7 +926,7 @@ namespace etl const size_t to_position = start + shift_amount; const size_t remaining_characters = current_size - start; const size_t max_shift_characters = CAPACITY - start - shift_amount; - const size_t characters_to_shift = std::min(max_shift_characters, remaining_characters); + const size_t characters_to_shift = ETLSTD::min(max_shift_characters, remaining_characters); // Will the string truncate? if ((start + shift_amount + remaining_characters) > CAPACITY) @@ -939,7 +939,7 @@ namespace etl current_size += shift_amount; } - std::copy_backward(position, position + characters_to_shift, begin() + to_position + characters_to_shift); + ETLSTD::copy_backward(position, position + characters_to_shift, begin() + to_position + characters_to_shift); while (first != last) { @@ -1046,7 +1046,7 @@ namespace etl etl::ibasic_string& erase(size_t position, size_t length_ = npos) { // Limit the length. - length_ = std::min(length_, size() - position); + length_ = ETLSTD::min(length_, size() - position); erase(begin() + position, begin() + position + length_); @@ -1060,7 +1060,7 @@ namespace etl //********************************************************************* iterator erase(iterator i_element) { - std::copy(i_element + 1, end(), i_element); + ETLSTD::copy(i_element + 1, end(), i_element); p_buffer[--current_size] = 0; return i_element; @@ -1076,8 +1076,8 @@ namespace etl //********************************************************************* iterator erase(iterator first, iterator last) { - std::copy(last, end(), first); - size_t n_delete = std::distance(first, last); + ETLSTD::copy(last, end(), first); + size_t n_delete = ETLSTD::distance(first, last); current_size -= n_delete; p_buffer[current_size] = 0; @@ -1107,7 +1107,7 @@ namespace etl is_truncated = true; } - size_t endpos = std::min(pos + len, size()); + size_t endpos = ETLSTD::min(pos + len, size()); for (size_t i = pos; i < endpos; ++i) { @@ -1129,7 +1129,7 @@ namespace etl return npos; } - const_iterator iposition = std::search(begin() + pos, end(), str.begin(), str.end()); + const_iterator iposition = ETLSTD::search(begin() + pos, end(), str.begin(), str.end()); if (iposition == end()) { @@ -1137,7 +1137,7 @@ namespace etl } else { - return std::distance(begin(), iposition); + return ETLSTD::distance(begin(), iposition); } } @@ -1155,7 +1155,7 @@ namespace etl } #endif - const_iterator iposition = std::search(begin() + pos, end(), s, s + etl::strlen(s)); + const_iterator iposition = ETLSTD::search(begin() + pos, end(), s, s + etl::strlen(s)); if (iposition == end()) { @@ -1163,7 +1163,7 @@ namespace etl } else { - return std::distance(begin(), iposition); + return ETLSTD::distance(begin(), iposition); } } @@ -1182,7 +1182,7 @@ namespace etl } #endif - const_iterator iposition = std::search(begin() + pos, end(), s, s + n); + const_iterator iposition = ETLSTD::search(begin() + pos, end(), s, s + n); if (iposition == end()) { @@ -1190,7 +1190,7 @@ namespace etl } else { - return std::distance(begin(), iposition); + return ETLSTD::distance(begin(), iposition); } } @@ -1201,11 +1201,11 @@ namespace etl //********************************************************************* size_t find(T c, size_t position = 0) const { - const_iterator i = std::find(begin() + position, end(), c); + const_iterator i = ETLSTD::find(begin() + position, end(), c); if (i != end()) { - return std::distance(begin(), i); + return ETLSTD::distance(begin(), i); } else { @@ -1232,7 +1232,7 @@ namespace etl position = size() - position; - const_reverse_iterator iposition = std::search(rbegin() + position, rend(), str.rbegin(), str.rend()); + const_reverse_iterator iposition = ETLSTD::search(rbegin() + position, rend(), str.rbegin(), str.rend()); if (iposition == rend()) { @@ -1240,7 +1240,7 @@ namespace etl } else { - return size() - str.size() - std::distance(rbegin(), iposition); + return size() - str.size() - ETLSTD::distance(rbegin(), iposition); } } @@ -1268,7 +1268,7 @@ namespace etl const_reverse_iterator srbegin(s + len); const_reverse_iterator srend(s); - const_reverse_iterator iposition = std::search(rbegin() + position, rend(), srbegin, srend); + const_reverse_iterator iposition = ETLSTD::search(rbegin() + position, rend(), srbegin, srend); if (iposition == rend()) { @@ -1276,7 +1276,7 @@ namespace etl } else { - return size() - len - std::distance(rbegin(), iposition); + return size() - len - ETLSTD::distance(rbegin(), iposition); } } @@ -1302,7 +1302,7 @@ namespace etl const_reverse_iterator srbegin(s + length_); const_reverse_iterator srend(s); - const_reverse_iterator iposition = std::search(rbegin() + position, rend(), srbegin, srend); + const_reverse_iterator iposition = ETLSTD::search(rbegin() + position, rend(), srbegin, srend); if (iposition == rend()) { @@ -1310,7 +1310,7 @@ namespace etl } else { - return size() - length_ - std::distance(rbegin(), iposition); + return size() - length_ - ETLSTD::distance(rbegin(), iposition); } } @@ -1328,11 +1328,11 @@ namespace etl position = size() - position; - const_reverse_iterator i = std::find(rbegin() + position, rend(), c); + const_reverse_iterator i = ETLSTD::find(rbegin() + position, rend(), c); if (i != rend()) { - return size() - std::distance(rbegin(), i) - 1; + return size() - ETLSTD::distance(rbegin(), i) - 1; } else { @@ -1351,7 +1351,7 @@ namespace etl ETL_ASSERT(position <= size(), ETL_ERROR(string_out_of_bounds)); // Limit the length. - length_ = std::min(length_, size() - position); + length_ = ETLSTD::min(length_, size() - position); // Erase the bit we want to replace. erase(position, length_); @@ -1397,8 +1397,8 @@ namespace etl ETL_ASSERT(subposition <= str.size(), ETL_ERROR(string_out_of_bounds)); // Limit the lengths. - length_ = std::min(length_, size() - position); - sublength = std::min(sublength, str.size() - subposition); + length_ = ETLSTD::min(length_, size() - position); + sublength = ETLSTD::min(sublength, str.size() - subposition); // Erase the bit we want to replace. erase(position, length_); @@ -1422,7 +1422,7 @@ namespace etl ETL_ASSERT(position <= size(), ETL_ERROR(string_out_of_bounds)); // Limit the length. - length_ = std::min(length_, size() - position); + length_ = ETLSTD::min(length_, size() - position); // Erase the bit we want to replace. erase(position, length_); @@ -1459,7 +1459,7 @@ namespace etl ETL_ASSERT(position <= size(), ETL_ERROR(string_out_of_bounds)); // Limit the length. - length_ = std::min(length_, size() - position); + length_ = ETLSTD::min(length_, size() - position); // Erase the bit we want to replace. erase(position, length_); @@ -1496,7 +1496,7 @@ namespace etl ETL_ASSERT(position <= size(), ETL_ERROR(string_out_of_bounds)); // Limit the length. - length_ = std::min(length_, size() - position); + length_ = ETLSTD::min(length_, size() - position); // Erase the bit we want to replace. erase(position, length_); @@ -1563,7 +1563,7 @@ namespace etl ETL_ASSERT(position <= size(), ETL_ERROR(string_out_of_bounds)); // Limit the length. - length_ = std::min(length_, size() - position); + length_ = ETLSTD::min(length_, size() - position); return compare(p_buffer + position, p_buffer + position + length_, @@ -1580,8 +1580,8 @@ namespace etl ETL_ASSERT(subposition <= str.size(), ETL_ERROR(string_out_of_bounds)); // Limit the lengths. - length_ = std::min(length_, size() - position); - sublength = std::min(sublength, str.size() - subposition); + length_ = ETLSTD::min(length_, size() - position); + sublength = ETLSTD::min(sublength, str.size() - subposition); return compare(p_buffer + position, p_buffer + position + length_, @@ -1721,7 +1721,7 @@ namespace etl return npos; } - position = std::min(position, size() - 1); + position = ETLSTD::min(position, size() - 1); const_reverse_iterator it = rbegin() + size() - position - 1; @@ -1754,7 +1754,7 @@ namespace etl return npos; } - position = std::min(position, size() - 1); + position = ETLSTD::min(position, size() - 1); const_reverse_iterator it = rbegin() + size() - position - 1; @@ -1878,7 +1878,7 @@ namespace etl return npos; } - position = std::min(position, size() - 1); + position = ETLSTD::min(position, size() - 1); const_reverse_iterator it = rbegin() + size() - position - 1; @@ -1916,7 +1916,7 @@ namespace etl return npos; } - position = std::min(position, size() - 1); + position = ETLSTD::min(position, size() - 1); const_reverse_iterator it = rbegin() + size() - position - 1; @@ -2115,7 +2115,7 @@ namespace etl template bool operator ==(const etl::ibasic_string& lhs, const etl::ibasic_string& rhs) { - return (lhs.size() == rhs.size()) && std::equal(lhs.begin(), lhs.end(), rhs.begin()); + return (lhs.size() == rhs.size()) && ETLSTD::equal(lhs.begin(), lhs.end(), rhs.begin()); } //*************************************************************************** @@ -2128,7 +2128,7 @@ namespace etl template bool operator ==(const etl::ibasic_string& lhs, const T* rhs) { - return (lhs.size() == etl::strlen(rhs)) && std::equal(lhs.begin(), lhs.end(), rhs); + return (lhs.size() == etl::strlen(rhs)) && ETLSTD::equal(lhs.begin(), lhs.end(), rhs); } //*************************************************************************** @@ -2141,7 +2141,7 @@ namespace etl template bool operator ==(const T* lhs, const etl::ibasic_string& rhs) { - return (rhs.size() == etl::strlen(lhs)) && std::equal(rhs.begin(), rhs.end(), lhs); + return (rhs.size() == etl::strlen(lhs)) && ETLSTD::equal(rhs.begin(), rhs.end(), lhs); } @@ -2195,7 +2195,7 @@ namespace etl template bool operator <(const etl::ibasic_string& lhs, const etl::ibasic_string& rhs) { - return std::lexicographical_compare(lhs.begin(), lhs.end(), rhs.begin(), rhs.end()); + return ETLSTD::lexicographical_compare(lhs.begin(), lhs.end(), rhs.begin(), rhs.end()); } //*************************************************************************** @@ -2208,7 +2208,7 @@ namespace etl template bool operator <(const etl::ibasic_string& lhs, const T* rhs) { - return std::lexicographical_compare(lhs.begin(), lhs.end(), rhs, rhs + etl::strlen(rhs)); + return ETLSTD::lexicographical_compare(lhs.begin(), lhs.end(), rhs, rhs + etl::strlen(rhs)); } //*************************************************************************** @@ -2221,7 +2221,7 @@ namespace etl template bool operator <(const T* lhs, const etl::ibasic_string& rhs) { - return std::lexicographical_compare(lhs, lhs + etl::strlen(lhs), rhs.begin(), rhs.end()); + return ETLSTD::lexicographical_compare(lhs, lhs + etl::strlen(lhs), rhs.begin(), rhs.end()); } diff --git a/include/etl/binary.h b/include/etl/binary.h index d701f37f..486ad9f6 100644 --- a/include/etl/binary.h +++ b/include/etl/binary.h @@ -238,7 +238,7 @@ namespace etl ETL_STATIC_ASSERT(etl::is_integral::value, "TValue not an integral type"); ETL_STATIC_ASSERT(etl::is_integral::value, "TReturn not an integral type"); ETL_STATIC_ASSERT(etl::is_signed::value, "TReturn not a signed type"); - ETL_STATIC_ASSERT(NBITS <= std::numeric_limits::digits, "NBITS too large for return type"); + ETL_STATIC_ASSERT(NBITS <= ETLSTD::numeric_limits::digits, "NBITS too large for return type"); struct S { @@ -260,8 +260,8 @@ namespace etl ETL_STATIC_ASSERT(etl::is_integral::value, "TValue not an integral type"); ETL_STATIC_ASSERT(etl::is_integral::value, "TReturn not an integral type"); ETL_STATIC_ASSERT(etl::is_signed::value, "TReturn not a signed type"); - ETL_STATIC_ASSERT(NBITS <= std::numeric_limits::digits, "NBITS too large for return type"); - ETL_STATIC_ASSERT(SHIFT <= std::numeric_limits::digits, "SHIFT too large"); + ETL_STATIC_ASSERT(NBITS <= ETLSTD::numeric_limits::digits, "NBITS too large for return type"); + ETL_STATIC_ASSERT(SHIFT <= ETLSTD::numeric_limits::digits, "SHIFT too large"); struct S { @@ -283,7 +283,7 @@ namespace etl ETL_STATIC_ASSERT(etl::is_integral::value, "TReturn not an integral type"); ETL_STATIC_ASSERT(etl::is_signed::value, "TReturn not a signed type"); - ETL_ASSERT((NBITS <= std::numeric_limits::digits), ETL_ERROR(binary_out_of_range)); + ETL_ASSERT((NBITS <= ETLSTD::numeric_limits::digits), ETL_ERROR(binary_out_of_range)); TReturn mask = TReturn(1) << (NBITS - 1); value = value & static_cast((TReturn(1) << NBITS) - 1); @@ -304,7 +304,7 @@ namespace etl ETL_STATIC_ASSERT(etl::is_integral::value, "TReturn not an integral type"); ETL_STATIC_ASSERT(etl::is_signed::value, "TReturn not a signed type"); - ETL_ASSERT((NBITS <= std::numeric_limits::digits), ETL_ERROR(binary_out_of_range)); + ETL_ASSERT((NBITS <= ETLSTD::numeric_limits::digits), ETL_ERROR(binary_out_of_range)); TReturn mask = TReturn(1) << (NBITS - 1); value = (value >> SHIFT) & static_cast((TReturn(1) << NBITS) - 1); diff --git a/include/etl/bit_stream.h b/include/etl/bit_stream.h index dc8a8285..dab6253f 100644 --- a/include/etl/bit_stream.h +++ b/include/etl/bit_stream.h @@ -68,7 +68,7 @@ namespace etl //*************************************************************************** bit_stream(char* begin_, char* end_) : pdata(reinterpret_cast(begin_)), - length(std::distance(begin_, end_)) + length(ETLSTD::distance(begin_, end_)) { restart(); } @@ -78,7 +78,7 @@ namespace etl //*************************************************************************** bit_stream(unsigned char* begin_, unsigned char* end_) : pdata(begin_), - length(std::distance(begin_, end_)) + length(ETLSTD::distance(begin_, end_)) { restart(); } @@ -128,7 +128,7 @@ namespace etl //*************************************************************************** void set_stream(char* begin_, char* end_) { - set_stream(begin_, std::distance(begin_, end_)); + set_stream(begin_, ETLSTD::distance(begin_, end_)); } //*************************************************************************** @@ -136,7 +136,7 @@ namespace etl //*************************************************************************** void set_stream(unsigned char* begin_, unsigned char* end_) { - set_stream(begin_, std::distance(begin_, end_)); + set_stream(begin_, ETLSTD::distance(begin_, end_)); } //*************************************************************************** @@ -266,7 +266,7 @@ namespace etl // Get the bits from the stream. while (width != 0) { - unsigned char mask_width = static_cast(std::min(width, bits_in_byte)); + unsigned char mask_width = static_cast(ETLSTD::min(width, bits_in_byte)); unsigned char chunk = get_chunk(mask_width); width -= mask_width; @@ -379,7 +379,7 @@ namespace etl // Send the bits to the stream. while (width != 0) { - unsigned char mask_width = static_cast(std::min(width, bits_in_byte)); + unsigned char mask_width = static_cast(ETLSTD::min(width, bits_in_byte)); width -= mask_width; uint32_t mask = ((uint32_t(1U) << mask_width) - 1U) << width; @@ -412,7 +412,7 @@ namespace etl // Send the bits to the stream. while (width != 0) { - unsigned char mask_width = static_cast(std::min(width, bits_in_byte)); + unsigned char mask_width = static_cast(ETLSTD::min(width, bits_in_byte)); width -= mask_width; uint64_t mask = ((uint64_t(1U) << mask_width) - 1U) << width; @@ -495,11 +495,11 @@ namespace etl // Network to host. if (etl::endianness::value() == etl::endian::little) { - std::reverse_copy(data, data + sizeof(T), temp); + ETLSTD::reverse_copy(data, data + sizeof(T), temp); } else { - std::copy(data, data + sizeof(T), temp); + ETLSTD::copy(data, data + sizeof(T), temp); } value = *reinterpret_cast(temp); @@ -516,11 +516,11 @@ namespace etl // Host to network. if (etl::endianness::value() == etl::endian::little) { - std::reverse_copy(pf, pf + sizeof(T), data); + ETLSTD::reverse_copy(pf, pf + sizeof(T), data); } else { - std::copy(pf, pf + sizeof(T), data); + ETLSTD::copy(pf, pf + sizeof(T), data); } } diff --git a/include/etl/char_traits.h b/include/etl/char_traits.h index ef5d2e74..164a3b8d 100644 --- a/include/etl/char_traits.h +++ b/include/etl/char_traits.h @@ -5,7 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl -http://www.etlcpp.com +https://www.etlcpp.com Copyright(c) 2016 jwellbelove @@ -53,7 +53,7 @@ typedef int32_t char32_t; namespace etl { template struct char_traits_types; - + template<> struct char_traits_types { typedef char char_type; @@ -62,7 +62,7 @@ namespace etl typedef size_t pos_type; typedef char state_type; }; - + template<> struct char_traits_types { typedef wchar_t char_type; @@ -71,54 +71,54 @@ namespace etl typedef size_t pos_type; typedef char state_type; }; - + template<> struct char_traits_types { typedef char16_t char_type; typedef uint_least16_t int_type; typedef long long off_type; typedef size_t pos_type; - typedef char state_type; + typedef char state_type; }; - + template<> struct char_traits_types { typedef char32_t char_type; typedef uint_least32_t int_type; typedef long long off_type; typedef size_t pos_type; - typedef char state_type; + typedef char state_type; }; - + //*************************************************************************** /// Character traits for any character type. //*************************************************************************** template struct char_traits : public char_traits_types - { + { typedef typename char_traits_types::char_type char_type; typedef typename char_traits_types::int_type int_type; typedef typename char_traits_types::off_type off_type; typedef typename char_traits_types::pos_type pos_type; typedef typename char_traits_types::state_type state_type; - + //************************************************************************* static bool eq(char_type a, char_type b) { return a == b; } - + //************************************************************************* static bool lt(char_type a, char_type b) { return a < b; - } - + } + //************************************************************************* static size_t length(const char_type* str) { size_t count = 0; - + if (str != 0) { while (*str++ != 0) @@ -126,27 +126,27 @@ namespace etl ++count; } } - + return count; } - + //************************************************************************* static void assign(char_type& r, const char_type& c) { r = c; } - + //************************************************************************* static char_type* assign(char_type* p, size_t n, char_type c) { if (p != 0) { - std::fill_n(p, n, c); + ETLSTD::fill_n(p, n, c); } - + return p; } - + //************************************************************************* static char_type* move(char_type* dest, const char_type* src, size_t count) { @@ -156,25 +156,25 @@ namespace etl } else { - etl::copy_n(std::reverse_iterator(src + count), + etl::copy_n(ETLSTD::reverse_iterator(src + count), count, - std::reverse_iterator(dest + count)); + ETLSTD::reverse_iterator(dest + count)); } - + return dest; } - + //************************************************************************* static char_type* copy(char_type* dest, const char_type* src, size_t count) { etl::copy_n(src, src + count, dest); - + return dest; } - + //************************************************************************* static int compare(const char_type* s1, const char_type* s2, size_t count) - { + { for (size_t i = 0; i < count; ++i) { if (*s1 < *s2) @@ -185,54 +185,54 @@ namespace etl { return 1; } - + ++s1; ++s2; } - + return 0; } - + //************************************************************************* static const char_type* find(const char_type* p, size_t count, const char_type& ch) - { + { for (size_t i = 0; i < count; ++i) { if (*p == ch) { return p; } - + ++p; } - + return 0; } - + //************************************************************************* static char_type to_char_type(int_type c) { return static_cast(c); } - + //************************************************************************* static int_type to_int_type(char_type c) { return static_cast(c); } - + //************************************************************************* static bool eq_int_type(int_type c1, int_type c2) { return (c1 == c2); } - + //************************************************************************* static int_type eof() { return -1; } - + //************************************************************************* static int_type not_eof(int_type e) { diff --git a/include/etl/checksum.h b/include/etl/checksum.h index 4809f346..38cf227d 100644 --- a/include/etl/checksum.h +++ b/include/etl/checksum.h @@ -5,7 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl -http://www.etlcpp.com +https://www.etlcpp.com Copyright(c) 2014 jwellbelove Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the "Software"), to deal diff --git a/include/etl/compare.h b/include/etl/compare.h index 5550dfbf..91195644 100644 --- a/include/etl/compare.h +++ b/include/etl/compare.h @@ -46,9 +46,9 @@ namespace etl { //*************************************************************************** /// Defines <=, >, >= interms of < - /// Default + /// Default //*************************************************************************** - template > + template > struct compare { typedef typename etl::parameter_type::type first_argument_type; diff --git a/include/etl/container.h b/include/etl/container.h index c7cbfe3a..f75c09bf 100644 --- a/include/etl/container.h +++ b/include/etl/container.h @@ -5,7 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl -http://www.etlcpp.com +https://www.etlcpp.com Copyright(c) 2014 jwellbelove @@ -177,9 +177,9 @@ namespace etl ///\ingroup container //***************************************************************************** template - ETL_CONSTEXPR std::reverse_iterator rbegin(const TValue(&data)[ARRAY_SIZE]) + ETL_CONSTEXPR ETLSTD::reverse_iterator rbegin(const TValue(&data)[ARRAY_SIZE]) { - return std::reverse_iterator(&data[ARRAY_SIZE]); + return ETLSTD::reverse_iterator(&data[ARRAY_SIZE]); } //***************************************************************************** @@ -187,9 +187,9 @@ namespace etl ///\ingroup container //***************************************************************************** template - ETL_CONSTEXPR std::reverse_iterator crbegin(const TValue(&data)[ARRAY_SIZE]) + ETL_CONSTEXPR ETLSTD::reverse_iterator crbegin(const TValue(&data)[ARRAY_SIZE]) { - return std::reverse_iterator(&data[ARRAY_SIZE]); + return ETLSTD::reverse_iterator(&data[ARRAY_SIZE]); } //***************************************************************************** @@ -227,9 +227,9 @@ namespace etl ///\ingroup container //***************************************************************************** template - ETL_CONSTEXPR std::reverse_iterator rend(const TValue(&data)[ARRAY_SIZE]) + ETL_CONSTEXPR ETLSTD::reverse_iterator rend(const TValue(&data)[ARRAY_SIZE]) { - return std::reverse_iterator(&data[0]); + return ETLSTD::reverse_iterator(&data[0]); } //***************************************************************************** @@ -237,9 +237,9 @@ namespace etl ///\ingroup container //***************************************************************************** template - ETL_CONSTEXPR std::reverse_iterator crend(const TValue(&data)[ARRAY_SIZE]) + ETL_CONSTEXPR ETLSTD::reverse_iterator crend(const TValue(&data)[ARRAY_SIZE]) { - return std::reverse_iterator(&data[0]); + return ETLSTD::reverse_iterator(&data[0]); } //***************************************************************************** @@ -249,7 +249,7 @@ namespace etl template TIterator next(TIterator iterator, ptrdiff_t n = 1) { - std::advance(iterator, n); + ETLSTD::advance(iterator, n); return iterator; } @@ -260,7 +260,7 @@ namespace etl template TIterator prev(TIterator iterator, ptrdiff_t n = 1) { - std::advance(iterator, -n); + ETLSTD::advance(iterator, -n); return iterator; } diff --git a/include/etl/crc16.h b/include/etl/crc16.h index 2705a01f..43632a39 100644 --- a/include/etl/crc16.h +++ b/include/etl/crc16.h @@ -5,7 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl -http://www.etlcpp.com +https://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/include/etl/crc16_ccitt.h b/include/etl/crc16_ccitt.h index d068a00c..9853ed70 100644 --- a/include/etl/crc16_ccitt.h +++ b/include/etl/crc16_ccitt.h @@ -5,7 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl -http://www.etlcpp.com +https://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/include/etl/crc16_kermit.h b/include/etl/crc16_kermit.h index ea1d8a6c..2de2b2da 100644 --- a/include/etl/crc16_kermit.h +++ b/include/etl/crc16_kermit.h @@ -5,7 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl -http://www.etlcpp.com +https://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/include/etl/crc32.h b/include/etl/crc32.h index 49cbc0a3..10d35a99 100644 --- a/include/etl/crc32.h +++ b/include/etl/crc32.h @@ -5,7 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl -http://www.etlcpp.com +https://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/include/etl/crc64_ecma.h b/include/etl/crc64_ecma.h index b08c93da..edbdaebb 100644 --- a/include/etl/crc64_ecma.h +++ b/include/etl/crc64_ecma.h @@ -5,7 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl -http://www.etlcpp.com +https://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/include/etl/crc8_ccitt.h b/include/etl/crc8_ccitt.h index ed72fa3d..2dd17d1c 100644 --- a/include/etl/crc8_ccitt.h +++ b/include/etl/crc8_ccitt.h @@ -5,7 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl -http://www.etlcpp.com +https://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/include/etl/cstring.h b/include/etl/cstring.h index 497aa40f..e58f025d 100644 --- a/include/etl/cstring.h +++ b/include/etl/cstring.h @@ -5,7 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl -http://www.etlcpp.com +https://www.etlcpp.com Copyright(c) 2016 jwellbelove @@ -180,7 +180,7 @@ namespace etl { ETL_ASSERT(position < this->size(), ETL_ERROR(string_out_of_bounds)); - length_ = std::min(length_, this->size() - position); + length_ = ETLSTD::min(length_, this->size() - position); new_string.assign(buffer + position, buffer + position + length_); } diff --git a/include/etl/cumulative_moving_average.h b/include/etl/cumulative_moving_average.h index df90d3d2..1480152d 100644 --- a/include/etl/cumulative_moving_average.h +++ b/include/etl/cumulative_moving_average.h @@ -44,8 +44,8 @@ namespace etl template ::value, - const bool IsFloat = std::is_floating_point::value> + const bool IsIntegral = etl::is_integral::value, + const bool IsFloat = etl::is_floating_point::value> class cumulative_moving_average; //*************************************************************************** diff --git a/include/etl/cyclic_value.h b/include/etl/cyclic_value.h index 3bb3bbe7..8665574a 100644 --- a/include/etl/cyclic_value.h +++ b/include/etl/cyclic_value.h @@ -5,7 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl -http://www.etlcpp.com +https://www.etlcpp.com Copyright(c) 2014 jwellbelove @@ -257,7 +257,7 @@ namespace etl //************************************************************************* void swap(cyclic_value& other) { - std::swap(value, other.value); + ETLSTD::swap(value, other.value); } //************************************************************************* @@ -531,9 +531,9 @@ namespace etl //************************************************************************* void swap(cyclic_value& other) { - std::swap(first_value, other.first_value); - std::swap(last_value, other.last_value); - std::swap(value, other.value); + ETLSTD::swap(first_value, other.first_value); + ETLSTD::swap(last_value, other.last_value); + ETLSTD::swap(value, other.value); } //************************************************************************* diff --git a/include/etl/debounce.h b/include/etl/debounce.h index ef0907c4..21981236 100644 --- a/include/etl/debounce.h +++ b/include/etl/debounce.h @@ -5,7 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl -http://www.etlcpp.com +https://www.etlcpp.com Copyright(c) 2016 jwellbelove diff --git a/include/etl/debug_count.h b/include/etl/debug_count.h index d5ecaf44..f3e97097 100644 --- a/include/etl/debug_count.h +++ b/include/etl/debug_count.h @@ -5,7 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl -http://www.etlcpp.com +https://www.etlcpp.com Copyright(c) 2017 jwellbelove diff --git a/include/etl/deque.h b/include/etl/deque.h index d103b319..e4710f6b 100644 --- a/include/etl/deque.h +++ b/include/etl/deque.h @@ -238,7 +238,7 @@ namespace etl #endif typedef T* pointer; typedef const T* const_pointer; - typedef typename std::iterator_traits::difference_type difference_type; + typedef typename ETLSTD::iterator_traits::difference_type difference_type; protected: @@ -633,8 +633,8 @@ namespace etl pointer p_buffer; }; - typedef std::reverse_iterator reverse_iterator; - typedef std::reverse_iterator const_reverse_iterator; + typedef ETLSTD::reverse_iterator reverse_iterator; + typedef ETLSTD::reverse_iterator const_reverse_iterator; //************************************************************************* /// Assigns a range to the deque. @@ -2232,7 +2232,7 @@ namespace etl typedef T& reference; typedef const T& const_reference; typedef size_t size_type; - typedef typename std::iterator_traits::difference_type difference_type; + typedef typename ETLSTD::iterator_traits::difference_type difference_type; //************************************************************************* /// Default constructor. diff --git a/include/etl/endianness.h b/include/etl/endianness.h index 3bb189cd..d4bbb1a7 100644 --- a/include/etl/endianness.h +++ b/include/etl/endianness.h @@ -5,7 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl -http://www.etlcpp.com +https://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/include/etl/enum_type.h b/include/etl/enum_type.h index 6a0bae8e..eb3e9d8e 100644 --- a/include/etl/enum_type.h +++ b/include/etl/enum_type.h @@ -5,7 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl -http://www.etlcpp.com +https://www.etlcpp.com Copyright(c) 2014 jwellbelove @@ -72,7 +72,7 @@ SOFTWARE. /// /// direction = value; // Implicit conversion from 'int'. **** Compilation error **** /// -/// std::cout << "Direction = " << direction.c_str(); // Prints "Direction = North" +/// ETLSTD::cout << "Direction = " << direction.c_str(); // Prints "Direction = North" ///\endcode /// If a conversion to a string is not required then the 'ETL_ENUM_TYPE' declaration may be omitted. /// In that case the c_str() function will return a "?". This will also be the case for any diff --git a/include/etl/error_handler.h b/include/etl/error_handler.h index 950655c3..5a8d0546 100644 --- a/include/etl/error_handler.h +++ b/include/etl/error_handler.h @@ -6,7 +6,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl -http://www.etlcpp.com +https://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/include/etl/exception.h b/include/etl/exception.h index d3c779b8..1a42671c 100644 --- a/include/etl/exception.h +++ b/include/etl/exception.h @@ -5,7 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl -http://www.etlcpp.com +https://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/include/etl/factorial.h b/include/etl/factorial.h index c42342f0..1767caa5 100644 --- a/include/etl/factorial.h +++ b/include/etl/factorial.h @@ -5,7 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl -http://www.etlcpp.com +https://www.etlcpp.com Copyright(c) 2014 jwellbelove @@ -39,7 +39,7 @@ SOFTWARE. /// fibonacci : Calculates the Nth factorial value. ///\ingroup maths -namespace etl +namespace etl { //*************************************************************************** ///\ingroup fibonacci diff --git a/include/etl/fibonacci.h b/include/etl/fibonacci.h index 9e3a5656..fd351890 100644 --- a/include/etl/fibonacci.h +++ b/include/etl/fibonacci.h @@ -5,7 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl -http://www.etlcpp.com +https://www.etlcpp.com Copyright(c) 2014 jwellbelove @@ -39,7 +39,7 @@ SOFTWARE. /// fibonacci : Calculates the Nth Fibonacci value. ///\ingroup maths -namespace etl +namespace etl { //*************************************************************************** ///\ingroup fibonacci diff --git a/include/etl/fixed_iterator.h b/include/etl/fixed_iterator.h index 15accbb1..0231b66e 100644 --- a/include/etl/fixed_iterator.h +++ b/include/etl/fixed_iterator.h @@ -5,7 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl -http://www.etlcpp.com +https://www.etlcpp.com Copyright(c) 2015 jwellbelove @@ -44,7 +44,7 @@ namespace etl /// This can be useful when using STL algorithms to interact with fixed memory locations such as registers. ///\ingroup iterator template - class fixed_iterator : std::iterator::iterator_category, typename std::iterator_traits::value_type> + class fixed_iterator : ETLSTD::iterator::iterator_category, typename ETLSTD::iterator_traits::value_type> { public: @@ -99,7 +99,7 @@ namespace etl //*************************************************************************** /// Dereference operator. //*************************************************************************** - typename std::iterator_traits::value_type operator *() + typename ETLSTD::iterator_traits::value_type operator *() { return *it; } @@ -107,7 +107,7 @@ namespace etl //*************************************************************************** /// Dereference operator. //*************************************************************************** - const typename std::iterator_traits::value_type operator *() const + const typename ETLSTD::iterator_traits::value_type operator *() const { return *it; } @@ -139,7 +139,7 @@ namespace etl //*************************************************************************** /// += operator. //*************************************************************************** - fixed_iterator& operator +=(typename std::iterator_traits::difference_type /*offset*/) + fixed_iterator& operator +=(typename ETLSTD::iterator_traits::difference_type /*offset*/) { return *this; } @@ -147,7 +147,7 @@ namespace etl //*************************************************************************** /// -= operator. //*************************************************************************** - fixed_iterator& operator -=(typename std::iterator_traits::difference_type /*offset*/) + fixed_iterator& operator -=(typename ETLSTD::iterator_traits::difference_type /*offset*/) { return *this; } @@ -180,7 +180,7 @@ namespace etl //***************************************************************************** template etl::fixed_iterator& operator +(etl::fixed_iterator& lhs, - typename std::iterator_traits::difference_type /*rhs*/) + typename ETLSTD::iterator_traits::difference_type /*rhs*/) { return lhs; } @@ -190,7 +190,7 @@ namespace etl //***************************************************************************** template etl::fixed_iterator& operator -(etl::fixed_iterator& lhs, - typename std::iterator_traits::difference_type /*rhs*/) + typename ETLSTD::iterator_traits::difference_type /*rhs*/) { return lhs; } @@ -199,7 +199,7 @@ namespace etl /// - fixed_iterator operator. //***************************************************************************** template - typename std::iterator_traits::difference_type operator -(etl::fixed_iterator& lhs, + typename ETLSTD::iterator_traits::difference_type operator -(etl::fixed_iterator& lhs, etl::fixed_iterator& rhs) { return TIterator(lhs) - TIterator(rhs); diff --git a/include/etl/flat_map.h b/include/etl/flat_map.h index 8d1e1fc8..ac3ba07c 100644 --- a/include/etl/flat_map.h +++ b/include/etl/flat_map.h @@ -85,9 +85,9 @@ namespace etl typedef typename refmap_t::iterator iterator; typedef typename refmap_t::const_iterator const_iterator; - typedef std::reverse_iterator reverse_iterator; - typedef std::reverse_iterator const_reverse_iterator; - typedef typename std::iterator_traits::difference_type difference_type; + typedef ETLSTD::reverse_iterator reverse_iterator; + typedef ETLSTD::reverse_iterator const_reverse_iterator; + typedef typename ETLSTD::iterator_traits::difference_type difference_type; protected: diff --git a/include/etl/flat_multimap.h b/include/etl/flat_multimap.h index b431cb10..404d1c56 100644 --- a/include/etl/flat_multimap.h +++ b/include/etl/flat_multimap.h @@ -86,9 +86,9 @@ namespace etl typedef typename refmap_t::iterator iterator; typedef typename refmap_t::const_iterator const_iterator; - typedef std::reverse_iterator reverse_iterator; - typedef std::reverse_iterator const_reverse_iterator; - typedef typename std::iterator_traits::difference_type difference_type; + typedef ETLSTD::reverse_iterator reverse_iterator; + typedef ETLSTD::reverse_iterator const_reverse_iterator; + typedef typename ETLSTD::iterator_traits::difference_type difference_type; protected: diff --git a/include/etl/flat_multiset.h b/include/etl/flat_multiset.h index 51c74f74..55e25089 100644 --- a/include/etl/flat_multiset.h +++ b/include/etl/flat_multiset.h @@ -80,9 +80,9 @@ namespace etl typedef typename refset_t::iterator iterator; typedef typename refset_t::const_iterator const_iterator; - typedef std::reverse_iterator reverse_iterator; - typedef std::reverse_iterator const_reverse_iterator; - typedef typename std::iterator_traits::difference_type difference_type; + typedef ETLSTD::reverse_iterator reverse_iterator; + typedef ETLSTD::reverse_iterator const_reverse_iterator; + typedef typename ETLSTD::iterator_traits::difference_type difference_type; protected: diff --git a/include/etl/flat_set.h b/include/etl/flat_set.h index 0c5f847c..8254b31c 100644 --- a/include/etl/flat_set.h +++ b/include/etl/flat_set.h @@ -82,9 +82,9 @@ namespace etl typedef typename refset_t::iterator iterator; typedef typename refset_t::const_iterator const_iterator; - typedef std::reverse_iterator reverse_iterator; - typedef std::reverse_iterator const_reverse_iterator; - typedef typename std::iterator_traits::difference_type difference_type; + typedef ETLSTD::reverse_iterator reverse_iterator; + typedef ETLSTD::reverse_iterator const_reverse_iterator; + typedef typename ETLSTD::iterator_traits::difference_type difference_type; protected: diff --git a/include/etl/fnv_1.h b/include/etl/fnv_1.h index 21065e1f..fad564e6 100644 --- a/include/etl/fnv_1.h +++ b/include/etl/fnv_1.h @@ -5,7 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl -http://www.etlcpp.com +https://www.etlcpp.com Copyright(c) 2014 jwellbelove @@ -41,7 +41,7 @@ SOFTWARE. #if defined(ETL_COMPILER_KEIL) -#pragma diag_suppress 1300 +#pragma diag_suppress 1300 #endif ///\defgroup fnv_1 FNV-1 & FNV-1a 32 & 64 bit hash calculations @@ -77,7 +77,7 @@ namespace etl static const uint64_t OFFSET_BASIS = 0xCBF29CE484222325ull; static const uint64_t PRIME = 0x00000100000001b3ull; }; - + //*************************************************************************** /// Calculates the fnv_1_64 hash. ///\ingroup fnv_1_64 @@ -172,7 +172,7 @@ namespace etl struct fnv_1_policy_32 { typedef uint32_t value_type; - + inline uint32_t initial() const { return OFFSET_BASIS; diff --git a/include/etl/forward_list.h b/include/etl/forward_list.h index 7617a2f9..9c1ffe3b 100644 --- a/include/etl/forward_list.h +++ b/include/etl/forward_list.h @@ -571,7 +571,7 @@ namespace etl const node_t* p_node; }; - typedef typename std::iterator_traits::difference_type difference_type; + typedef typename ETLSTD::iterator_traits::difference_type difference_type; //************************************************************************* /// Gets the beginning of the forward_list. diff --git a/include/etl/frame_check_sequence.h b/include/etl/frame_check_sequence.h index c3d95009..6e451805 100644 --- a/include/etl/frame_check_sequence.h +++ b/include/etl/frame_check_sequence.h @@ -74,7 +74,7 @@ namespace etl template frame_check_sequence(TIterator begin, const TIterator end) { - ETL_STATIC_ASSERT(sizeof(typename std::iterator_traits::value_type) == 1, "Type not supported"); + ETL_STATIC_ASSERT(sizeof(typename ETLSTD::iterator_traits::value_type) == 1, "Type not supported"); reset(); add(begin, end); @@ -96,7 +96,7 @@ namespace etl template void add(TIterator begin, const TIterator end) { - ETL_STATIC_ASSERT(sizeof(typename std::iterator_traits::value_type) == 1, "Type not supported"); + ETL_STATIC_ASSERT(sizeof(typename ETLSTD::iterator_traits::value_type) == 1, "Type not supported"); while (begin != end) { diff --git a/include/etl/function.h b/include/etl/function.h index 00eda71d..53568b82 100644 --- a/include/etl/function.h +++ b/include/etl/function.h @@ -5,7 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl -http://www.etlcpp.com +https://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/include/etl/functional.h b/include/etl/functional.h index eb0e85b4..68300759 100644 --- a/include/etl/functional.h +++ b/include/etl/functional.h @@ -5,7 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl -http://www.etlcpp.com +https://www.etlcpp.com Copyright(c) 2014 jwellbelove @@ -67,7 +67,7 @@ namespace etl *t = value; return *this; } - + T& get() const { return *t; diff --git a/include/etl/hash.h b/include/etl/hash.h index 42c2b2a0..a0458262 100644 --- a/include/etl/hash.h +++ b/include/etl/hash.h @@ -5,7 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl -http://www.etlcpp.com +https://www.etlcpp.com Copyright(c) 2014 jwellbelove @@ -362,7 +362,7 @@ namespace etl } u; u.v = v; - + return u.s; } else diff --git a/include/etl/ihash.h b/include/etl/ihash.h index 8d47a8e1..18d11bca 100644 --- a/include/etl/ihash.h +++ b/include/etl/ihash.h @@ -5,7 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl -http://www.etlcpp.com +https://www.etlcpp.com Copyright(c) 2015 jwellbelove diff --git a/include/etl/instance_count.h b/include/etl/instance_count.h index 2d94f317..74742960 100644 --- a/include/etl/instance_count.h +++ b/include/etl/instance_count.h @@ -5,7 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl -http://www.etlcpp.com +https://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/include/etl/integral_limits.h b/include/etl/integral_limits.h index 4adf9fad..4a6421e2 100644 --- a/include/etl/integral_limits.h +++ b/include/etl/integral_limits.h @@ -5,7 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl -http://www.etlcpp.com +https://www.etlcpp.com Copyright(c) 2014 jwellbelove @@ -41,7 +41,7 @@ SOFTWARE. //***************************************************************************** ///\defgroup integral_limits integral_limits -/// A set of templated compile time constants that mirror some of std::numeric_limits funtionality. +/// A set of templated compile time constants that mirror some of ETLSTD::numeric_limits funtionality. ///\ingroup utilities //***************************************************************************** diff --git a/include/etl/intrusive_forward_list.h b/include/etl/intrusive_forward_list.h index 57d0c565..7303e984 100644 --- a/include/etl/intrusive_forward_list.h +++ b/include/etl/intrusive_forward_list.h @@ -494,7 +494,7 @@ namespace etl const value_type* p_value; }; - typedef typename std::iterator_traits::difference_type difference_type; + typedef typename ETLSTD::iterator_traits::difference_type difference_type; //************************************************************************* /// Constructor. diff --git a/include/etl/intrusive_list.h b/include/etl/intrusive_list.h index b7b575b1..c3fde511 100644 --- a/include/etl/intrusive_list.h +++ b/include/etl/intrusive_list.h @@ -579,7 +579,7 @@ namespace etl const value_type* p_value; }; - typedef typename std::iterator_traits::difference_type difference_type; + typedef typename ETLSTD::iterator_traits::difference_type difference_type; //************************************************************************* /// Constructor. diff --git a/include/etl/io_port.h b/include/etl/io_port.h index 3fc39d00..29033438 100644 --- a/include/etl/io_port.h +++ b/include/etl/io_port.h @@ -5,7 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl -http://www.etlcpp.com +https://www.etlcpp.com Copyright(c) 2014 jwellbelove @@ -48,7 +48,7 @@ namespace etl /// Read write port. //*************************************************************************** template - class io_port_rw : public std::iterator + class io_port_rw : public ETLSTD::iterator { public: @@ -56,7 +56,7 @@ namespace etl typedef volatile const T* const_pointer; typedef volatile T& reference; typedef volatile const T& const_reference; - + /// Read. operator T() const { @@ -105,7 +105,7 @@ namespace etl { return *this; } - + /// Get the IO port address. pointer get_address() { @@ -128,7 +128,7 @@ namespace etl /// Read only port. //*************************************************************************** template - class io_port_ro : public std::iterator + class io_port_ro : public ETLSTD::iterator { public: @@ -192,7 +192,7 @@ namespace etl /// Write only port. //*************************************************************************** template - class io_port_wo : public std::iterator + class io_port_wo : public ETLSTD::iterator { public: @@ -256,7 +256,7 @@ namespace etl /// Write only port with shadow register. //*************************************************************************** template - class io_port_wos : public std::iterator + class io_port_wos : public ETLSTD::iterator { public: @@ -335,7 +335,7 @@ namespace etl /// Specialisation for dynamic addresses. //*************************************************************************** template - class io_port_rw : public std::iterator + class io_port_rw : public ETLSTD::iterator { public: @@ -446,7 +446,7 @@ namespace etl /// Specialisation for dynamic addresses. //*************************************************************************** template - class io_port_ro : public std::iterator + class io_port_ro : public ETLSTD::iterator { public: @@ -535,7 +535,7 @@ namespace etl /// Specialisation for dynamic addresses. //*************************************************************************** template - class io_port_wo : public std::iterator + class io_port_wo : public ETLSTD::iterator { public: @@ -616,7 +616,7 @@ namespace etl { return *this; } - + private: /// Read disabled. @@ -630,7 +630,7 @@ namespace etl /// Specialisation for dynamic addresses. //*************************************************************************** template - class io_port_wos : public std::iterator + class io_port_wos : public ETLSTD::iterator { public: @@ -639,7 +639,7 @@ namespace etl typedef volatile T& reference; typedef volatile const T& const_reference; - class iterator : public std::iterator + class iterator : public ETLSTD::iterator { typedef io_port_wos iop_t; @@ -695,7 +695,7 @@ namespace etl iop_t* p_iop; }; - + /// Default constructor. io_port_wos() : address(nullptr) @@ -797,7 +797,7 @@ namespace etl { return *this; } - + private: T shadow_value; diff --git a/include/etl/iterator.h b/include/etl/iterator.h index b1ebb5cd..ffd2e983 100644 --- a/include/etl/iterator.h +++ b/include/etl/iterator.h @@ -5,7 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl -http://www.etlcpp.com +https://www.etlcpp.com Copyright(c) 2017 jwellbelove @@ -45,37 +45,37 @@ namespace etl template struct is_input_iterator { - static const bool value = etl::is_same::iterator_category, std::input_iterator_tag>::value; + static const bool value = etl::is_same::iterator_category, ETLSTD::input_iterator_tag>::value; }; template struct is_output_iterator { - static const bool value = etl::is_same::iterator_category, std::output_iterator_tag>::value; + static const bool value = etl::is_same::iterator_category, ETLSTD::output_iterator_tag>::value; }; template struct is_forward_iterator { - static const bool value = etl::is_same::iterator_category, std::forward_iterator_tag>::value; + static const bool value = etl::is_same::iterator_category, ETLSTD::forward_iterator_tag>::value; }; template struct is_bidirectional_iterator { - static const bool value = etl::is_same::iterator_category, std::bidirectional_iterator_tag>::value; + static const bool value = etl::is_same::iterator_category, ETLSTD::bidirectional_iterator_tag>::value; }; template struct is_random_iterator { - static const bool value = etl::is_same::iterator_category, std::random_access_iterator_tag>::value; + static const bool value = etl::is_same::iterator_category, ETLSTD::random_access_iterator_tag>::value; }; template struct is_input_iterator_concept { - static const bool value = etl::is_input_iterator::value || + static const bool value = etl::is_input_iterator::value || etl::is_forward_iterator::value || etl::is_bidirectional_iterator::value || etl::is_random_iterator::value; diff --git a/include/etl/jenkins.h b/include/etl/jenkins.h index 2217b775..8c075a22 100644 --- a/include/etl/jenkins.h +++ b/include/etl/jenkins.h @@ -5,7 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl -http://www.etlcpp.com +https://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/include/etl/list.h b/include/etl/list.h index b927d3f0..0c10d42d 100644 --- a/include/etl/list.h +++ b/include/etl/list.h @@ -675,10 +675,10 @@ namespace etl const node_t* p_node; }; - typedef typename std::iterator_traits::difference_type difference_type; + typedef typename ETLSTD::iterator_traits::difference_type difference_type; - typedef std::reverse_iterator reverse_iterator; - typedef std::reverse_iterator const_reverse_iterator; + typedef ETLSTD::reverse_iterator reverse_iterator; + typedef ETLSTD::reverse_iterator const_reverse_iterator; //************************************************************************* /// Gets the beginning of the list. diff --git a/include/etl/log.h b/include/etl/log.h index 0971d515..f8de2ec8 100644 --- a/include/etl/log.h +++ b/include/etl/log.h @@ -5,7 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl -http://www.etlcpp.com +https://www.etlcpp.com Copyright(c) 2014 jwellbelove @@ -41,7 +41,7 @@ SOFTWARE. /// log10 : Calculates logs to base 10, rounded down to the nearest integer.
///\ingroup maths -namespace etl +namespace etl { //*************************************************************************** ///\ingroup log diff --git a/include/etl/map.h b/include/etl/map.h index b33dc199..4da5f44e 100644 --- a/include/etl/map.h +++ b/include/etl/map.h @@ -803,10 +803,10 @@ namespace etl friend class const_iterator; - typedef typename std::iterator_traits::difference_type difference_type; + typedef typename ETLSTD::iterator_traits::difference_type difference_type; - typedef std::reverse_iterator reverse_iterator; - typedef std::reverse_iterator const_reverse_iterator; + typedef ETLSTD::reverse_iterator reverse_iterator; + typedef ETLSTD::reverse_iterator const_reverse_iterator; //************************************************************************* /// Gets the beginning of the map. diff --git a/include/etl/memory.h b/include/etl/memory.h index f3dea117..a2dfd51f 100644 --- a/include/etl/memory.h +++ b/include/etl/memory.h @@ -60,10 +60,10 @@ namespace etl ///\ingroup memory //***************************************************************************** template - typename etl::enable_if::value_type>::value, TOutputIterator>::type + typename etl::enable_if::value_type>::value, TOutputIterator>::type uninitialized_fill(TOutputIterator o_begin, TOutputIterator o_end, const T& value) { - std::fill(o_begin, o_end, value); + ETLSTD::fill(o_begin, o_end, value); return o_end; } @@ -73,10 +73,10 @@ namespace etl ///\ingroup memory //***************************************************************************** template - typename etl::enable_if::value_type>::value, TOutputIterator>::type + typename etl::enable_if::value_type>::value, TOutputIterator>::type uninitialized_fill(TOutputIterator o_begin, TOutputIterator o_end, const T& value) { - typedef typename std::iterator_traits::value_type value_type; + typedef typename ETLSTD::iterator_traits::value_type value_type; while (o_begin != o_end) { @@ -93,12 +93,12 @@ namespace etl ///\ingroup memory //***************************************************************************** template - typename etl::enable_if::value_type>::value, TOutputIterator>::type + typename etl::enable_if::value_type>::value, TOutputIterator>::type uninitialized_fill(TOutputIterator o_begin, TOutputIterator o_end, const T& value, TCounter& count) { - count += int32_t(std::distance(o_begin, o_end)); + count += int32_t(ETLSTD::distance(o_begin, o_end)); - std::fill(o_begin, o_end, value); + ETLSTD::fill(o_begin, o_end, value); return o_end; } @@ -109,10 +109,10 @@ namespace etl ///\ingroup memory //***************************************************************************** template - typename etl::enable_if::value_type>::value, TOutputIterator>::type + typename etl::enable_if::value_type>::value, TOutputIterator>::type uninitialized_fill(TOutputIterator o_begin, TOutputIterator o_end, const T& value, TCounter& count) { - count += int32_t(std::distance(o_begin, o_end)); + count += int32_t(ETLSTD::distance(o_begin, o_end)); etl::uninitialized_fill(o_begin, o_end, value); @@ -147,10 +147,10 @@ namespace etl ///\ingroup memory //***************************************************************************** template - typename etl::enable_if::value_type>::value, TOutputIterator>::type + typename etl::enable_if::value_type>::value, TOutputIterator>::type uninitialized_copy(TInputIterator i_begin, TInputIterator i_end, TOutputIterator o_begin) { - return std::copy(i_begin, i_end, o_begin); + return ETLSTD::copy(i_begin, i_end, o_begin); } //***************************************************************************** @@ -158,10 +158,10 @@ namespace etl ///\ingroup memory //***************************************************************************** template - typename etl::enable_if::value_type>::value, TOutputIterator>::type + typename etl::enable_if::value_type>::value, TOutputIterator>::type uninitialized_copy(TInputIterator i_begin, TInputIterator i_end, TOutputIterator o_begin) { - typedef typename std::iterator_traits::value_type value_type; + typedef typename ETLSTD::iterator_traits::value_type value_type; TOutputIterator o_end = o_begin; @@ -181,11 +181,11 @@ namespace etl ///\ingroup memory //***************************************************************************** template - typename etl::enable_if::value_type>::value, TOutputIterator>::type + typename etl::enable_if::value_type>::value, TOutputIterator>::type uninitialized_copy(TInputIterator i_begin, TInputIterator i_end, TOutputIterator o_begin, TCounter& count) { - TOutputIterator o_end = std::copy(i_begin, i_end, o_begin); - count += int32_t(std::distance(o_begin, o_end)); + TOutputIterator o_end = ETLSTD::copy(i_begin, i_end, o_begin); + count += int32_t(ETLSTD::distance(o_begin, o_end)); return o_end; } @@ -196,12 +196,12 @@ namespace etl ///\ingroup memory //***************************************************************************** template - typename etl::enable_if::value_type>::value, TOutputIterator>::type + typename etl::enable_if::value_type>::value, TOutputIterator>::type uninitialized_copy(TInputIterator i_begin, TInputIterator i_end, TOutputIterator o_begin, TCounter& count) { TOutputIterator o_end = etl::uninitialized_copy(i_begin, i_end, o_begin); - count += int32_t(std::distance(o_begin, o_end)); + count += int32_t(ETLSTD::distance(o_begin, o_end)); return o_end; } @@ -278,7 +278,7 @@ namespace etl ///\ingroup memory //***************************************************************************** template - typename etl::enable_if::value_type>::value, void>::type + typename etl::enable_if::value_type>::value, void>::type uninitialized_default_construct(TOutputIterator /*o_begin*/, TOutputIterator /*o_end*/) { } @@ -288,10 +288,10 @@ namespace etl ///\ingroup memory //***************************************************************************** template - typename etl::enable_if::value_type>::value, void>::type + typename etl::enable_if::value_type>::value, void>::type uninitialized_default_construct(TOutputIterator o_begin, TOutputIterator o_end) { - typedef typename std::iterator_traits::value_type value_type; + typedef typename ETLSTD::iterator_traits::value_type value_type; while (o_begin != o_end) { @@ -306,10 +306,10 @@ namespace etl ///\ingroup memory //***************************************************************************** template - typename etl::enable_if::value_type>::value, void>::type + typename etl::enable_if::value_type>::value, void>::type uninitialized_default_construct(TOutputIterator o_begin, TOutputIterator o_end, TCounter& count) { - count = int32_t(std::distance(o_begin, o_end)); + count = int32_t(ETLSTD::distance(o_begin, o_end)); } //***************************************************************************** @@ -318,10 +318,10 @@ namespace etl ///\ingroup memory //***************************************************************************** template - typename etl::enable_if::value_type>::value, void>::type + typename etl::enable_if::value_type>::value, void>::type uninitialized_default_construct(TOutputIterator o_begin, TOutputIterator o_end, TCounter& count) { - count += int32_t(std::distance(o_begin, o_end)); + count += int32_t(ETLSTD::distance(o_begin, o_end)); etl::uninitialized_default_construct(o_begin, o_end); } @@ -331,7 +331,7 @@ namespace etl ///\ingroup memory //***************************************************************************** template - typename etl::enable_if::value_type>::value, TOutputIterator>::type + typename etl::enable_if::value_type>::value, TOutputIterator>::type uninitialized_default_construct_n(TOutputIterator o_begin, TSize n) { TOutputIterator o_end = o_begin + n; @@ -344,7 +344,7 @@ namespace etl ///\ingroup memory //***************************************************************************** template - typename etl::enable_if::value_type>::value, TOutputIterator>::type + typename etl::enable_if::value_type>::value, TOutputIterator>::type uninitialized_default_construct_n(TOutputIterator o_begin, TSize n) { TOutputIterator o_end = o_begin + n; @@ -360,7 +360,7 @@ namespace etl ///\ingroup memory //***************************************************************************** template - typename etl::enable_if::value_type>::value, TOutputIterator>::type + typename etl::enable_if::value_type>::value, TOutputIterator>::type uninitialized_default_construct_n(TOutputIterator o_begin, TSize n, TCounter& count) { TOutputIterator o_end = o_begin + n; @@ -376,7 +376,7 @@ namespace etl ///\ingroup memory //***************************************************************************** template - typename etl::enable_if::value_type>::value, TOutputIterator>::type + typename etl::enable_if::value_type>::value, TOutputIterator>::type uninitialized_default_construct_n(TOutputIterator o_begin, TSize n, TCounter& count) { TOutputIterator o_end = o_begin + n; @@ -427,7 +427,7 @@ namespace etl template void create_copy_at(T* p, T&& value) { - ::new (p) T(std::move(value)); + ::new (p) T(ETLSTD::move(value)); } #endif @@ -484,7 +484,7 @@ namespace etl template T& make_copy_at(T* p, T&& other) { - ::new (p) T(std::move(other)); + ::new (p) T(ETLSTD::move(other)); return *reinterpret_cast(p); } #endif @@ -520,7 +520,7 @@ namespace etl template T& make_value_at(T* p, TParameter&& value) { - ::new (p) T(std::move(value)); + ::new (p) T(ETLSTD::move(value)); return *reinterpret_cast(p); } #endif @@ -542,12 +542,12 @@ namespace etl ///\ingroup memory //***************************************************************************** template - typename etl::enable_if::value_type>::value, void>::type + typename etl::enable_if::value_type>::value, void>::type uninitialized_value_construct(TOutputIterator o_begin, TOutputIterator o_end) { - typedef typename std::iterator_traits::value_type value_type; + typedef typename ETLSTD::iterator_traits::value_type value_type; - std::fill(o_begin, o_end, value_type()); + ETLSTD::fill(o_begin, o_end, value_type()); } //***************************************************************************** @@ -555,10 +555,10 @@ namespace etl ///\ingroup memory //***************************************************************************** template - typename etl::enable_if::value_type>::value, void>::type + typename etl::enable_if::value_type>::value, void>::type uninitialized_value_construct(TOutputIterator o_begin, TOutputIterator o_end) { - typedef typename std::iterator_traits::value_type value_type; + typedef typename ETLSTD::iterator_traits::value_type value_type; while (o_begin != o_end) { @@ -575,7 +575,7 @@ namespace etl template void uninitialized_value_construct(TOutputIterator o_begin, TOutputIterator o_end, TCounter& count) { - count += int32_t(std::distance(o_begin, o_end)); + count += int32_t(ETLSTD::distance(o_begin, o_end)); etl::uninitialized_value_construct(o_begin, o_end); } @@ -662,7 +662,7 @@ namespace etl ///\ingroup memory //***************************************************************************** template - typename etl::enable_if::value_type>::value, void>::type + typename etl::enable_if::value_type>::value, void>::type destroy(TIterator /*i_begin*/, TIterator /*i_end*/) { } @@ -672,7 +672,7 @@ namespace etl ///\ingroup memory //***************************************************************************** template - typename etl::enable_if::value_type>::value, void>::type + typename etl::enable_if::value_type>::value, void>::type destroy(TIterator i_begin, TIterator i_end) { while (i_begin != i_end) @@ -688,10 +688,10 @@ namespace etl ///\ingroup memory //***************************************************************************** template - typename etl::enable_if::value_type>::value, void>::type + typename etl::enable_if::value_type>::value, void>::type destroy(TIterator i_begin, TIterator i_end, TCounter& count) { - count -= int32_t(std::distance(i_begin, i_end)); + count -= int32_t(ETLSTD::distance(i_begin, i_end)); } //***************************************************************************** @@ -700,10 +700,10 @@ namespace etl ///\ingroup memory //***************************************************************************** template - typename etl::enable_if::value_type>::value, void>::type + typename etl::enable_if::value_type>::value, void>::type destroy(TIterator i_begin, TIterator i_end, TCounter& count) { - count -= int32_t(std::distance(i_begin, i_end)); + count -= int32_t(ETLSTD::distance(i_begin, i_end)); while (i_begin != i_end) { @@ -717,7 +717,7 @@ namespace etl ///\ingroup memory //***************************************************************************** template - typename etl::enable_if::value_type>::value, TIterator>::type + typename etl::enable_if::value_type>::value, TIterator>::type destroy_n(TIterator i_begin, TSize n) { return i_begin + n; @@ -728,7 +728,7 @@ namespace etl ///\ingroup memory //***************************************************************************** template - typename etl::enable_if::value_type>::value, TIterator>::type + typename etl::enable_if::value_type>::value, TIterator>::type destroy_n(TIterator i_begin, TSize n) { while (n > 0) @@ -747,7 +747,7 @@ namespace etl ///\ingroup memory //***************************************************************************** template - typename etl::enable_if::value_type>::value, TIterator>::type + typename etl::enable_if::value_type>::value, TIterator>::type destroy_n(TIterator i_begin, TSize n, TCounter& count) { count -= n; @@ -760,7 +760,7 @@ namespace etl ///\ingroup memory //***************************************************************************** template - typename etl::enable_if::value_type>::value, TIterator>::type + typename etl::enable_if::value_type>::value, TIterator>::type destroy_n(TIterator i_begin, TSize n, TCounter& count) { count -= n; @@ -909,7 +909,7 @@ namespace etl void swap(unique_ptr& value) { - std::swap(p, value.p); + ETLSTD::swap(p, value.p); } ETL_CONSTEXPR operator bool() const @@ -1043,7 +1043,7 @@ namespace etl void swap(unique_ptr& v) { - std::swap(p, v.p); + ETLSTD::swap(p, v.p); } ETL_CONSTEXPR operator bool() const @@ -1157,7 +1157,7 @@ namespace etl template void memory_clear_range(volatile T* begin, volatile T* end) { - const size_t n = static_cast(std::distance(begin, end)); + const size_t n = static_cast(ETLSTD::distance(begin, end)); memory_clear_range(begin, n); } @@ -1215,7 +1215,7 @@ namespace etl template void memory_set_range(volatile T* begin, volatile T* end, const char value) { - const size_t n = static_cast(std::distance(begin, end)); + const size_t n = static_cast(ETLSTD::distance(begin, end)); memory_set_range(begin, n, value); } diff --git a/include/etl/message.h b/include/etl/message.h index 83714cb3..02baf2d5 100644 --- a/include/etl/message.h +++ b/include/etl/message.h @@ -3,7 +3,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl -http://www.etlcpp.com +https://www.etlcpp.com Copyright(c) 2017 jwellbelove @@ -68,7 +68,7 @@ namespace etl { public: - imessage(etl::message_id_t id) + imessage(etl::message_id_t id) : message_id(id) { } diff --git a/include/etl/message_bus.h b/include/etl/message_bus.h index 7e19ccd6..df7d1975 100644 --- a/include/etl/message_bus.h +++ b/include/etl/message_bus.h @@ -102,7 +102,7 @@ namespace etl if (ok) { - router_list_t::iterator irouter = std::upper_bound(router_list.begin(), + router_list_t::iterator irouter = ETLSTD::upper_bound(router_list.begin(), router_list.end(), router.get_message_router_id(), compare_router_id()); @@ -125,7 +125,7 @@ namespace etl } else { - std::pair range = std::equal_range(router_list.begin(), + ETLSTD::pair range = ETLSTD::equal_range(router_list.begin(), router_list.end(), id, compare_router_id()); @@ -137,7 +137,7 @@ namespace etl //******************************************* void unsubscribe(etl::imessage_router& router) { - router_list_t::iterator irouter = std::find(router_list.begin(), + router_list_t::iterator irouter = ETLSTD::find(router_list.begin(), router_list.end(), &router); @@ -212,7 +212,7 @@ namespace etl router_list_t::iterator irouter = router_list.begin(); // Find routers with the id. - std::pair range = std::equal_range(router_list.begin(), + ETLSTD::pair range = ETLSTD::equal_range(router_list.begin(), router_list.end(), destination_router_id, compare_router_id()); @@ -230,7 +230,7 @@ namespace etl // Do any message buses. // These are always at the end of the list. - irouter = std::lower_bound(router_list.begin(), + irouter = ETLSTD::lower_bound(router_list.begin(), router_list.end(), etl::imessage_bus::MESSAGE_BUS, compare_router_id()); diff --git a/include/etl/multimap.h b/include/etl/multimap.h index c74a4fcf..832e0c78 100644 --- a/include/etl/multimap.h +++ b/include/etl/multimap.h @@ -954,10 +954,10 @@ namespace etl }; friend class const_iterator; - typedef typename std::iterator_traits::difference_type difference_type; + typedef typename ETLSTD::iterator_traits::difference_type difference_type; - typedef std::reverse_iterator reverse_iterator; - typedef std::reverse_iterator const_reverse_iterator; + typedef ETLSTD::reverse_iterator reverse_iterator; + typedef ETLSTD::reverse_iterator const_reverse_iterator; //************************************************************************* /// Gets the beginning of the multimap. diff --git a/include/etl/multiset.h b/include/etl/multiset.h index 018fbe35..0c09c74e 100644 --- a/include/etl/multiset.h +++ b/include/etl/multiset.h @@ -920,10 +920,10 @@ namespace etl }; friend class const_iterator; - typedef typename std::iterator_traits::difference_type difference_type; + typedef typename ETLSTD::iterator_traits::difference_type difference_type; - typedef std::reverse_iterator reverse_iterator; - typedef std::reverse_iterator const_reverse_iterator; + typedef ETLSTD::reverse_iterator reverse_iterator; + typedef ETLSTD::reverse_iterator const_reverse_iterator; //************************************************************************* /// Gets the beginning of the multiset. diff --git a/include/etl/murmur3.h b/include/etl/murmur3.h index cb4fa0e0..3875d199 100644 --- a/include/etl/murmur3.h +++ b/include/etl/murmur3.h @@ -5,7 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl -http://www.etlcpp.com +https://www.etlcpp.com Copyright(c) 2014 jwellbelove @@ -81,7 +81,7 @@ namespace etl murmur3(TIterator begin, const TIterator end, value_type seed_ = 0) : seed(seed_) { - ETL_STATIC_ASSERT(sizeof(typename std::iterator_traits::value_type) == 1, "Incompatible type"); + ETL_STATIC_ASSERT(sizeof(typename ETLSTD::iterator_traits::value_type) == 1, "Incompatible type"); reset(); while (begin != end) @@ -119,7 +119,7 @@ namespace etl template void add(TIterator begin, const TIterator end) { - ETL_STATIC_ASSERT(sizeof(typename std::iterator_traits::value_type) == 1, "Incompatible type"); + ETL_STATIC_ASSERT(sizeof(typename ETLSTD::iterator_traits::value_type) == 1, "Incompatible type"); ETL_ASSERT(!is_finalised, ETL_ERROR(hash_finalised)); while (begin != end) diff --git a/include/etl/mutex/mutex_std.h b/include/etl/mutex/mutex_std.h index 30908f8c..ee467f19 100644 --- a/include/etl/mutex/mutex_std.h +++ b/include/etl/mutex/mutex_std.h @@ -37,7 +37,7 @@ namespace etl { //*************************************************************************** ///\ingroup mutex - ///\brief This mutex class is implemented using std::mutex. + ///\brief This mutex class is implemented using ETLSTD::mutex. //*************************************************************************** class mutex { diff --git a/include/etl/nullptr.h b/include/etl/nullptr.h index 1ee34149..f80d9f9f 100644 --- a/include/etl/nullptr.h +++ b/include/etl/nullptr.h @@ -5,7 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl -http://www.etlcpp.com +https://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/include/etl/numeric.h b/include/etl/numeric.h index f13f7f9c..1ed0958c 100644 --- a/include/etl/numeric.h +++ b/include/etl/numeric.h @@ -5,7 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl -http://www.etlcpp.com +https://www.etlcpp.com Copyright(c) 2014 jwellbelove @@ -37,10 +37,10 @@ SOFTWARE. ///\ingroup utilities namespace etl -{ +{ //*************************************************************************** /// iota - /// Reverse engineered version of std::iota for non C++ 0x11 compilers. + /// Reverse engineered version of ETLSTD::iota for non C++ 0x11 compilers. /// Fills a range of elements with sequentially increasing values starting with value. ///\param first An iterator to the first position to fill. ///\param last An iterator to the last + 1 position. diff --git a/include/etl/observer.h b/include/etl/observer.h index 6332a6cf..ee2bbce6 100644 --- a/include/etl/observer.h +++ b/include/etl/observer.h @@ -5,7 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl -http://www.etlcpp.com +https://www.etlcpp.com Copyright(c) 2014 jwellbelove @@ -115,7 +115,7 @@ namespace etl void add_observer(TObserver& observer) { // See if we already have it in our list. - typename Observer_List::const_iterator i_observer = std::find(observer_list.begin(), + typename Observer_List::const_iterator i_observer = ETLSTD::find(observer_list.begin(), observer_list.end(), &observer); @@ -138,7 +138,7 @@ namespace etl bool remove_observer(TObserver& observer) { // See if we have it in our list. - typename Observer_List::iterator i_observer = std::find(observer_list.begin(), + typename Observer_List::iterator i_observer = ETLSTD::find(observer_list.begin(), observer_list.end(), &observer); diff --git a/include/etl/parameter_type.h b/include/etl/parameter_type.h index 7d5e0dc6..019daaea 100644 --- a/include/etl/parameter_type.h +++ b/include/etl/parameter_type.h @@ -5,7 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl -http://www.etlcpp.com +https://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/include/etl/pearson.h b/include/etl/pearson.h index 459c7f52..cd3a7f0e 100644 --- a/include/etl/pearson.h +++ b/include/etl/pearson.h @@ -5,7 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl -http://www.etlcpp.com +https://www.etlcpp.com Copyright(c) 2014 jwellbelove @@ -81,7 +81,7 @@ namespace etl pearson(TIterator begin, const TIterator end) : first(true) { - ETL_STATIC_ASSERT(sizeof(typename std::iterator_traits::value_type) == 1, "Type not supported"); + ETL_STATIC_ASSERT(sizeof(typename ETLSTD::iterator_traits::value_type) == 1, "Type not supported"); reset(); add(begin, end); @@ -103,7 +103,7 @@ namespace etl template void add(TIterator begin, const TIterator end) { - ETL_STATIC_ASSERT(sizeof(typename std::iterator_traits::value_type) == 1, "Type not supported"); + ETL_STATIC_ASSERT(sizeof(typename ETLSTD::iterator_traits::value_type) == 1, "Type not supported"); while (begin != end) { diff --git a/include/etl/platform.h b/include/etl/platform.h index 76182726..3a311416 100644 --- a/include/etl/platform.h +++ b/include/etl/platform.h @@ -64,7 +64,7 @@ SOFTWARE. // The macros below are dependent on the profile. #if defined(ETL_COMPILER_MICROSOFT) - // Disable warning of deprecated std::iterator. + // Disable warning of deprecated ETLSTD::iterator. #pragma warning(disable : 4996) #endif diff --git a/include/etl/power.h b/include/etl/power.h index aaa144d9..34577748 100644 --- a/include/etl/power.h +++ b/include/etl/power.h @@ -5,7 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl -http://www.etlcpp.com +https://www.etlcpp.com Copyright(c) 2014 jwellbelove @@ -41,7 +41,7 @@ SOFTWARE. /// power : Calculates N to the power POWER. ///\ingroup maths -namespace etl +namespace etl { //*************************************************************************** ///\ingroup power diff --git a/include/etl/priority_queue.h b/include/etl/priority_queue.h index d84c0b9e..8272de65 100644 --- a/include/etl/priority_queue.h +++ b/include/etl/priority_queue.h @@ -126,7 +126,7 @@ namespace etl typedef T& reference; ///< A reference to the type used in the queue. typedef const T& const_reference; ///< A const reference to the type used in the queue. typedef typename TContainer::size_type size_type; ///< The type used for determining the size of the queue. - typedef typename std::iterator_traits::difference_type difference_type; + typedef typename ETLSTD::iterator_traits::difference_type difference_type; private: diff --git a/include/etl/private/ivectorpointer.h b/include/etl/private/ivectorpointer.h index eef997f2..0c57a987 100644 --- a/include/etl/private/ivectorpointer.h +++ b/include/etl/private/ivectorpointer.h @@ -5,7 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl -http://www.etlcpp.com +https://www.etlcpp.com Copyright(c) 2016 jwellbelove @@ -56,10 +56,10 @@ namespace etl typedef const value_type* const_pointer; typedef value_type* iterator; typedef const value_type* const_iterator; - typedef std::reverse_iterator reverse_iterator; - typedef std::reverse_iterator const_reverse_iterator; + typedef ETLSTD::reverse_iterator reverse_iterator; + typedef ETLSTD::reverse_iterator const_reverse_iterator; typedef size_t size_type; - typedef typename std::iterator_traits::difference_type difference_type; + typedef typename ETLSTD::iterator_traits::difference_type difference_type; protected: @@ -441,7 +441,7 @@ namespace etl //********************************************************************* void initialise_source_external_buffer_after_move() { - ETL_SUBTRACT_DEBUG_COUNT(int32_t(std::distance(p_buffer, p_end))) + ETL_SUBTRACT_DEBUG_COUNT(int32_t(ETLSTD::distance(p_buffer, p_end))) p_end = p_buffer; } @@ -451,7 +451,7 @@ namespace etl //********************************************************************* void initialise_destination_external_buffer_after_move() { - ETL_ADD_DEBUG_COUNT(int32_t(std::distance(p_buffer, p_end))) + ETL_ADD_DEBUG_COUNT(int32_t(ETLSTD::distance(p_buffer, p_end))) } }; @@ -467,10 +467,10 @@ namespace etl typedef const value_type* const_pointer; typedef value_type* iterator; typedef const value_type* const_iterator; - typedef std::reverse_iterator reverse_iterator; - typedef std::reverse_iterator const_reverse_iterator; + typedef ETLSTD::reverse_iterator reverse_iterator; + typedef ETLSTD::reverse_iterator const_reverse_iterator; typedef size_t size_type; - typedef typename std::iterator_traits::difference_type difference_type; + typedef typename ETLSTD::iterator_traits::difference_type difference_type; protected: @@ -852,7 +852,7 @@ namespace etl //********************************************************************* void initialise_source_external_buffer_after_move() { - ETL_SUBTRACT_DEBUG_COUNT(int32_t(std::distance(p_buffer, p_end))) + ETL_SUBTRACT_DEBUG_COUNT(int32_t(ETLSTD::distance(p_buffer, p_end))) p_end = p_buffer; } @@ -862,7 +862,7 @@ namespace etl //********************************************************************* void initialise_destination_external_buffer_after_move() { - ETL_ADD_DEBUG_COUNT(int32_t(std::distance(p_buffer, p_end))) + ETL_ADD_DEBUG_COUNT(int32_t(ETLSTD::distance(p_buffer, p_end))) } }; diff --git a/include/etl/private/pvoidvector.h b/include/etl/private/pvoidvector.h index 474e2d19..dd419910 100644 --- a/include/etl/private/pvoidvector.h +++ b/include/etl/private/pvoidvector.h @@ -5,7 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl -http://www.etlcpp.com +https://www.etlcpp.com Copyright(c) 2016 jwellbelove @@ -67,10 +67,10 @@ namespace etl typedef const value_type* const_pointer; typedef value_type* iterator; typedef const value_type* const_iterator; - typedef std::reverse_iterator reverse_iterator; - typedef std::reverse_iterator const_reverse_iterator; + typedef ETLSTD::reverse_iterator reverse_iterator; + typedef ETLSTD::reverse_iterator const_reverse_iterator; typedef size_t size_type; - typedef std::iterator_traits::difference_type difference_type; + typedef ETLSTD::iterator_traits::difference_type difference_type; public: @@ -211,7 +211,7 @@ namespace etl // Size up if necessary. if (p_end < p_new_end) { - std::fill(p_end, p_new_end, value); + ETLSTD::fill(p_end, p_new_end, value); } p_end = p_new_end; @@ -326,7 +326,7 @@ namespace etl void assign(TIterator first, TIterator last) { #if defined(ETL_DEBUG) - difference_type d = std::distance(first, last); + difference_type d = ETLSTD::distance(first, last); ETL_ASSERT(static_cast(d) <= CAPACITY, ETL_ERROR(vector_full)); #endif @@ -402,7 +402,7 @@ namespace etl if (position != end()) { ++p_end; - std::copy_backward(position, end() - 1, end()); + ETLSTD::copy_backward(position, end() - 1, end()); *position = value; } else @@ -424,8 +424,8 @@ namespace etl { ETL_ASSERT((size() + 1) <= CAPACITY, ETL_ERROR(vector_full)); - std::copy_backward(position, p_end, p_end + n); - std::fill_n(position, n, value); + ETLSTD::copy_backward(position, p_end, p_end + n); + ETLSTD::fill_n(position, n, value); p_end += n; } @@ -441,12 +441,12 @@ namespace etl template void insert(iterator position, TIterator first, TIterator last) { - size_t count = std::distance(first, last); + size_t count = ETLSTD::distance(first, last); ETL_ASSERT((size() + count) <= CAPACITY, ETL_ERROR(vector_full)); - std::copy_backward(position, p_end, p_end + count); - std::copy(first, last, position); + ETLSTD::copy_backward(position, p_end, p_end + count); + ETLSTD::copy(first, last, position); p_end += count; } @@ -457,7 +457,7 @@ namespace etl //********************************************************************* iterator erase(iterator i_element) { - std::copy(i_element + 1, end(), i_element); + ETLSTD::copy(i_element + 1, end(), i_element); --p_end; return i_element; @@ -473,8 +473,8 @@ namespace etl //********************************************************************* iterator erase(iterator first, iterator last) { - std::copy(last, end(), first); - size_t n_delete = std::distance(first, last); + ETLSTD::copy(last, end(), first); + size_t n_delete = ETLSTD::distance(first, last); // Just adjust the count. p_end -= n_delete; @@ -580,7 +580,7 @@ namespace etl //*************************************************************************** inline bool operator ==(const etl::pvoidvector& lhs, const etl::pvoidvector& rhs) { - return (lhs.size() == rhs.size()) && std::equal(lhs.begin(), lhs.end(), rhs.begin()); + return (lhs.size() == rhs.size()) && ETLSTD::equal(lhs.begin(), lhs.end(), rhs.begin()); } //*************************************************************************** @@ -604,7 +604,7 @@ namespace etl //*************************************************************************** inline bool operator <(const etl::pvoidvector& lhs, const etl::pvoidvector& rhs) { - return std::lexicographical_compare(lhs.begin(), lhs.end(), rhs.begin(), rhs.end()); + return ETLSTD::lexicographical_compare(lhs.begin(), lhs.end(), rhs.begin(), rhs.end()); } //*************************************************************************** diff --git a/include/etl/private/to_string_helper.h b/include/etl/private/to_string_helper.h index 898ec569..db69b65a 100644 --- a/include/etl/private/to_string_helper.h +++ b/include/etl/private/to_string_helper.h @@ -56,7 +56,7 @@ namespace etl template void add_alignment(TIString& str, typename TIString::iterator position, const etl::basic_format_spec& format) { - uint32_t length = static_cast(std::distance(position, str.end())); + uint32_t length = static_cast(ETLSTD::distance(position, str.end())); if (length < format.get_width()) { @@ -165,7 +165,7 @@ namespace etl } // Reverse the string we appended. - std::reverse(start, str.end()); + ETLSTD::reverse(start, str.end()); } etl::private_to_string::add_alignment(str, start, format); @@ -234,14 +234,14 @@ namespace etl iterator start = str.end(); - if (std::isnan(value) || std::isinf(value)) + if (ETLSTD::isnan(value) || ETLSTD::isinf(value)) { - etl::private_to_string::add_nan_inf(std::isnan(value), std::isinf(value), str); + etl::private_to_string::add_nan_inf(ETLSTD::isnan(value), ETLSTD::isinf(value), str); } else { // Make sure we format the two halves correctly. - uint32_t max_precision = std::numeric_limits::digits10; + uint32_t max_precision = ETLSTD::numeric_limits::digits10; etl::basic_format_spec integral_format = format; integral_format.decimal().width(0).precision(format.get_precision() > max_precision ? max_precision : format.get_precision()); diff --git a/include/etl/private/vector_base.h b/include/etl/private/vector_base.h index d4487ac3..abbfdfc3 100644 --- a/include/etl/private/vector_base.h +++ b/include/etl/private/vector_base.h @@ -5,7 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl -http://www.etlcpp.com +https://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/include/etl/radix.h b/include/etl/radix.h index a4ba926b..43ca5f45 100644 --- a/include/etl/radix.h +++ b/include/etl/radix.h @@ -5,7 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl -http://www.etlcpp.com +https://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/include/etl/random.h b/include/etl/random.h index 459f22f2..fdbe535a 100644 --- a/include/etl/random.h +++ b/include/etl/random.h @@ -5,7 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl -http://www.etlcpp.com +https://www.etlcpp.com Copyright(c) 2017 jwellbelove diff --git a/include/etl/ratio.h b/include/etl/ratio.h index dfc94e86..303c6723 100644 --- a/include/etl/ratio.h +++ b/include/etl/ratio.h @@ -5,7 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl -http://www.etlcpp.com +https://www.etlcpp.com Copyright(c) 2016 jwellbelove @@ -41,8 +41,8 @@ namespace etl template struct ratio { - static const std::intmax_t num = NUM; - static const std::intmax_t den = DEN; + static const ETLSTD::intmax_t num = NUM; + static const ETLSTD::intmax_t den = DEN; }; #if INT_MAX > INT32_MAX diff --git a/include/etl/reference_flat_map.h b/include/etl/reference_flat_map.h index e0392d18..2d71b9c2 100644 --- a/include/etl/reference_flat_map.h +++ b/include/etl/reference_flat_map.h @@ -316,9 +316,9 @@ namespace etl typename lookup_t::const_iterator ilookup; }; - typedef std::reverse_iterator reverse_iterator; - typedef std::reverse_iterator const_reverse_iterator; - typedef typename std::iterator_traits::difference_type difference_type; + typedef ETLSTD::reverse_iterator reverse_iterator; + typedef ETLSTD::reverse_iterator const_reverse_iterator; + typedef typename ETLSTD::iterator_traits::difference_type difference_type; protected: @@ -524,7 +524,7 @@ namespace etl template void assign(TIterator first, TIterator last) { - ETL_STATIC_ASSERT((etl::is_same::value_type>::value), "Incompatible data for assign"); + ETL_STATIC_ASSERT((etl::is_same::value_type>::value), "Incompatible data for assign"); #if defined(ETL_DEBUG) difference_type d = std::distance(first, last); diff --git a/include/etl/reference_flat_multimap.h b/include/etl/reference_flat_multimap.h index f4051566..558de0af 100644 --- a/include/etl/reference_flat_multimap.h +++ b/include/etl/reference_flat_multimap.h @@ -291,9 +291,9 @@ namespace etl typename lookup_t::const_iterator ilookup; }; - typedef std::reverse_iterator reverse_iterator; - typedef std::reverse_iterator const_reverse_iterator; - typedef typename std::iterator_traits::difference_type difference_type; + typedef ETLSTD::reverse_iterator reverse_iterator; + typedef ETLSTD::reverse_iterator const_reverse_iterator; + typedef typename ETLSTD::iterator_traits::difference_type difference_type; protected: diff --git a/include/etl/reference_flat_multiset.h b/include/etl/reference_flat_multiset.h index 0b612f37..9416b9e1 100644 --- a/include/etl/reference_flat_multiset.h +++ b/include/etl/reference_flat_multiset.h @@ -316,9 +316,9 @@ namespace etl public: - typedef std::reverse_iterator reverse_iterator; - typedef std::reverse_iterator const_reverse_iterator; - typedef typename std::iterator_traits::difference_type difference_type; + typedef ETLSTD::reverse_iterator reverse_iterator; + typedef ETLSTD::reverse_iterator const_reverse_iterator; + typedef typename ETLSTD::iterator_traits::difference_type difference_type; //********************************************************************* /// Returns an iterator to the beginning of the reference_flat_multiset. diff --git a/include/etl/reference_flat_set.h b/include/etl/reference_flat_set.h index 7a34c743..8a1f28d0 100644 --- a/include/etl/reference_flat_set.h +++ b/include/etl/reference_flat_set.h @@ -316,9 +316,9 @@ namespace etl public: - typedef std::reverse_iterator reverse_iterator; - typedef std::reverse_iterator const_reverse_iterator; - typedef typename std::iterator_traits::difference_type difference_type; + typedef ETLSTD::reverse_iterator reverse_iterator; + typedef ETLSTD::reverse_iterator const_reverse_iterator; + typedef typename ETLSTD::iterator_traits::difference_type difference_type; //********************************************************************* /// Returns an iterator to the beginning of the reference_flat_set. diff --git a/include/etl/scheduler.h b/include/etl/scheduler.h index d8d645cd..034209f2 100644 --- a/include/etl/scheduler.h +++ b/include/etl/scheduler.h @@ -3,7 +3,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl -http://www.etlcpp.com +https://www.etlcpp.com Copyright(c) 2017 jwellbelove @@ -285,7 +285,7 @@ namespace etl if (!task_list.full()) { - typename task_list_t::iterator itask = std::upper_bound(task_list.begin(), + typename task_list_t::iterator itask = ETLSTD::upper_bound(task_list.begin(), task_list.end(), task.get_task_priority(), compare_priority()); diff --git a/include/etl/set.h b/include/etl/set.h index 57035d19..2d000497 100644 --- a/include/etl/set.h +++ b/include/etl/set.h @@ -760,10 +760,10 @@ namespace etl }; friend class const_iterator; - typedef typename std::iterator_traits::difference_type difference_type; + typedef typename ETLSTD::iterator_traits::difference_type difference_type; - typedef std::reverse_iterator reverse_iterator; - typedef std::reverse_iterator const_reverse_iterator; + typedef ETLSTD::reverse_iterator reverse_iterator; + typedef ETLSTD::reverse_iterator const_reverse_iterator; //************************************************************************* /// Assignment operator. diff --git a/include/etl/state_chart.h b/include/etl/state_chart.h index 4602a882..442aacc9 100644 --- a/include/etl/state_chart.h +++ b/include/etl/state_chart.h @@ -235,7 +235,7 @@ namespace etl } else { - return std::find_if(state_table.begin(), + return ETLSTD::find_if(state_table.begin(), state_table.end(), is_state(state_id)); } @@ -280,7 +280,7 @@ namespace etl while (t != transition_table.end()) { // Scan the transition table from the latest position. - t = std::find_if(t, + t = ETLSTD::find_if(t, transition_table.end(), is_transition(event_id, current_state_id)); diff --git a/include/etl/static_assert.h b/include/etl/static_assert.h index 4d09cbb9..31f36599 100644 --- a/include/etl/static_assert.h +++ b/include/etl/static_assert.h @@ -3,7 +3,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl -http://www.etlcpp.com +https://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/include/etl/stl/algorithm.h b/include/etl/stl/algorithm.h index 43c1aaa7..8a8dd39d 100644 --- a/include/etl/stl/algorithm.h +++ b/include/etl/stl/algorithm.h @@ -32,6 +32,7 @@ SOFTWARE. #define ETL_STL_ALGORITHM_INCLUDED #include "../platform.h" +#include "choose_namespace.h" #if defined(ETL_NO_STL) #include "alternate/algorithm.h" diff --git a/include/etl/stl/alternate/algorithm.h b/include/etl/stl/alternate/algorithm.h index c0e1dba9..849b39a2 100644 --- a/include/etl/stl/alternate/algorithm.h +++ b/include/etl/stl/alternate/algorithm.h @@ -41,22 +41,12 @@ SOFTWARE. #include "functional.h" #include "utility.h" -#if defined(ETL_IN_UNIT_TEST) - #if !defined(ETLSTD) -#define ETLSTD etlstd - #endif namespace etlstd -#else - #if !defined(ETLSTD) -#define ETLSTD std - #endif -namespace std -#endif { //*************************************************************************** // advance template - typename etl::enable_if::iterator_tag, ETLSTD::random_access_iterator_tag>::value, void>::type + typename etl::enable_if::iterator_tag, etlstd::random_access_iterator_tag>::value, void>::type advance(TIterator itr, TDistance distance) { while (distance-- != 0) @@ -66,7 +56,7 @@ namespace std } template - typename etl::enable_if::iterator_tag, ETLSTD::random_access_iterator_tag>::value, void>::type + typename etl::enable_if::iterator_tag, etlstd::random_access_iterator_tag>::value, void>::type advance(TIterator itr, TDistance distance) { return itr += distance; @@ -78,10 +68,10 @@ namespace std template typename etl::enable_if::value && etl::is_pointer::value && - etl::is_pod::value_type>::value, TIterator2>::type + etl::is_pod::value_type>::value, TIterator2>::type copy(TIterator1 sb, TIterator1 se, TIterator2 db) { - typedef typename ETLSTD::iterator_traits::value_type value_t; + typedef typename etlstd::iterator_traits::value_type value_t; return TIterator2(memcpy(db, sb, sizeof(value_t) * (se - sb))); } @@ -90,7 +80,7 @@ namespace std template typename etl::enable_if::value || !etl::is_pointer::value || - !etl::is_pod::value_type>::value, TIterator2>::type + !etl::is_pod::value_type>::value, TIterator2>::type copy(TIterator1 sb, TIterator1 se, TIterator2 db) { while (sb != se) @@ -107,10 +97,10 @@ namespace std template typename etl::enable_if::value && etl::is_pointer::value && - etl::is_pod::value_type>::value, TIterator2>::type + etl::is_pod::value_type>::value, TIterator2>::type copy_n(TIterator1 sb, TSize count, TIterator2 db) { - typedef typename ETLSTD::iterator_traits::value_type value_t; + typedef typename etlstd::iterator_traits::value_type value_t; return TIterator2(memcpy(db, sb, sizeof(value_t) * count)); } @@ -119,7 +109,7 @@ namespace std template typename etl::enable_if::value || !etl::is_pointer::value || - !etl::is_pod::value_type>::value, TIterator2>::type + !etl::is_pod::value_type>::value, TIterator2>::type copy_n(TIterator1 sb, TSize count, TIterator2 db) { while (count != 0) @@ -137,10 +127,10 @@ namespace std template typename etl::enable_if::value && etl::is_pointer::value && - etl::is_pod::value_type>::value, TIterator2>::type + etl::is_pod::value_type>::value, TIterator2>::type copy_backward(TIterator1 sb, TIterator1 se, TIterator2 de) { - typedef typename ETLSTD::iterator_traits::value_type value_t; + typedef typename etlstd::iterator_traits::value_type value_t; const size_t length = (se - sb); @@ -151,7 +141,7 @@ namespace std template typename etl::enable_if::value || !etl::is_pointer::value || - !etl::is_pod::value_type>::value, TIterator2>::type + !etl::is_pod::value_type>::value, TIterator2>::type copy_backward(TIterator1 sb, TIterator1 se, TIterator2 de) { while (se != sb) @@ -169,7 +159,7 @@ namespace std { while (sb != se) { - *db++ = std::move(*sb++); + *db++ = etlstd::move(*sb++); } return db; @@ -182,7 +172,7 @@ namespace std { while (sb != se) { - *(--de) = std::move(*(--se)); + *(--de) = etlstd::move(*(--se)); } return de; @@ -193,16 +183,16 @@ namespace std template TIterator lower_bound(TIterator first, TIterator last, const TValue& value, TCompare compare) { - typedef typename ETLSTD::iterator_traits::difference_type difference_t; + typedef typename etlstd::iterator_traits::difference_type difference_t; - difference_t count = ETLSTD::distance(first, last); + difference_t count = etlstd::distance(first, last); while (count > 0) { TIterator itr = first; difference_t step = count / 2; - ETLSTD::advance(itr, step); + etlstd::advance(itr, step); if (compare(*itr, value)) { @@ -221,9 +211,9 @@ namespace std template TIterator lower_bound(TIterator first, TIterator last, const TValue& value) { - typedef ETLSTD::less::value_type> compare; + typedef etlstd::less::value_type> compare; - return ETLSTD::lower_bound(first, last, value, compare()); + return etlstd::lower_bound(first, last, value, compare()); } //*************************************************************************** @@ -231,16 +221,16 @@ namespace std template TIterator upper_bound(TIterator first, TIterator last, const TValue& value, TCompare compare) { - typedef typename ETLSTD::iterator_traits::difference_type difference_t; + typedef typename etlstd::iterator_traits::difference_type difference_t; - difference_t count = ETLSTD::distance(first, last); + difference_t count = etlstd::distance(first, last); while (count > 0) { TIterator itr = first; difference_t step = count / 2; - ETLSTD::advance(itr, step); + etlstd::advance(itr, step); if (!compare(value, *itr)) { @@ -259,27 +249,27 @@ namespace std template TIterator upper_bound(TIterator first, TIterator last, const TValue& value) { - typedef ETLSTD::less::value_type> compare; + typedef etlstd::less::value_type> compare; - return ETLSTD::upper_bound(first, last, value, compare()); + return etlstd::upper_bound(first, last, value, compare()); } //*************************************************************************** // equal_range template - ETLSTD::pair equal_range(TIterator first, TIterator last, const TValue& value, TCompare compare) + etlstd::pair equal_range(TIterator first, TIterator last, const TValue& value, TCompare compare) { - return ETLSTD::make_pair(ETLSTD::lower_bound(first, last, value, compare), - ETLSTD::upper_bound(first, last, value, compare)); + return etlstd::make_pair(etlstd::lower_bound(first, last, value, compare), + etlstd::upper_bound(first, last, value, compare)); } template - ETLSTD::pair equal_range(TIterator first, TIterator last, const TValue& value) + etlstd::pair equal_range(TIterator first, TIterator last, const TValue& value) { - typedef ETLSTD::less::value_type> compare; + typedef etlstd::less::value_type> compare; - return ETLSTD::make_pair(ETLSTD::lower_bound(first, last, value, compare()), - ETLSTD::upper_bound(first, last, value, compare())); + return etlstd::make_pair(etlstd::lower_bound(first, last, value, compare()), + etlstd::upper_bound(first, last, value, compare())); } //*************************************************************************** @@ -413,7 +403,7 @@ namespace std template void iter_swap(TIterator1 a, TIterator2 b) { - typename ETLSTD::iterator_traits::value_type c = *a; + typename etlstd::iterator_traits::value_type c = *a; *a = *b; *b = c; } @@ -421,7 +411,7 @@ namespace std //*************************************************************************** // equal template - typename etl::enable_if::value || !etl::is_pointer::value || !etl::is_pod::value_type>::value, bool>::type + typename etl::enable_if::value || !etl::is_pointer::value || !etl::is_pod::value_type>::value, bool>::type equal(TIterator1 first1, TIterator1 last1, TIterator2 first2) { while (first1 != last1) @@ -436,10 +426,10 @@ namespace std } template - typename etl::enable_if::value && etl::is_pointer::value && etl::is_pod::value_type>::value, bool>::type + typename etl::enable_if::value && etl::is_pointer::value && etl::is_pod::value_type>::value, bool>::type equal(TIterator1 first1, TIterator1 last1, TIterator2 first2) { - typedef typename ETLSTD::iterator_traits::value_type value_t; + typedef typename etlstd::iterator_traits::value_type value_t; return (memcmp(first1, first2, sizeof(value_t) * (last1 - last1)) == 0); } @@ -476,9 +466,9 @@ namespace std bool lexicographical_compare(TIterator1 first1, TIterator1 last1, TIterator2 first2, TIterator2 last2) { - typedef ETLSTD::less::value_type> compare; + typedef etlstd::less::value_type> compare; - return ETLSTD::lexicographical_compare(first1, last1, first2, last2, compare()); + return etlstd::lexicographical_compare(first1, last1, first2, last2, compare()); } //*************************************************************************** @@ -492,9 +482,9 @@ namespace std template const T& min(const T& a, const T& b) { - typedef ETLSTD::less compare; + typedef etlstd::less compare; - return ETLSTD::min(a, b, compare()); + return etlstd::min(a, b, compare()); } //*************************************************************************** @@ -508,9 +498,9 @@ namespace std template const T& max(const T& a, const T& b) { - typedef ETLSTD::less compare; + typedef etlstd::less compare; - return ETLSTD::max(a, b, compare()); + return etlstd::max(a, b, compare()); } //*************************************************************************** @@ -612,8 +602,8 @@ namespace std template void pop_heap(TIterator first, TIterator last, TCompare compare) { - typedef typename ETLSTD::iterator_traits::value_type value_t; - typedef typename ETLSTD::iterator_traits::difference_type distance_t; + typedef typename etlstd::iterator_traits::value_type value_t; + typedef typename etlstd::iterator_traits::difference_type distance_t; value_t value = last[-1]; last[-1] = first[0]; @@ -625,17 +615,17 @@ namespace std template void pop_heap(TIterator first, TIterator last) { - typedef ETLSTD::less::value_type> compare; + typedef etlstd::less::value_type> compare; - ETLSTD::pop_heap(first, last, compare()); + etlstd::pop_heap(first, last, compare()); } // Push Heap template void push_heap(TIterator first, TIterator last, TCompare compare) { - typedef typename ETLSTD::iterator_traits::difference_type difference_t; - typedef typename ETLSTD::iterator_traits::value_type value_t; + typedef typename etlstd::iterator_traits::difference_type difference_t; + typedef typename etlstd::iterator_traits::value_type value_t; private_heap::push_heap(first, difference_t(last - first - 1), difference_t(0), value_t(*(last - 1)), compare); } @@ -644,16 +634,16 @@ namespace std template void push_heap(TIterator first, TIterator last) { - typedef ETLSTD::less::value_type> compare; + typedef etlstd::less::value_type> compare; - ETLSTD::push_heap(first, last, compare()); + etlstd::push_heap(first, last, compare()); } // Make Heap template void make_heap(TIterator first, TIterator last, TCompare compare) { - typedef typename ETLSTD::iterator_traits::difference_type difference_t; + typedef typename etlstd::iterator_traits::difference_type difference_t; if ((last - first) < 2) { @@ -680,16 +670,16 @@ namespace std template void make_heap(TIterator first, TIterator last) { - typedef ETLSTD::less::value_type> compare; + typedef etlstd::less::value_type> compare; - ETLSTD::make_heap(first, last, compare()); + etlstd::make_heap(first, last, compare()); } // Is Heap template bool is_heap(TIterator first, TIterator last) { - typedef ETLSTD::less::value_type> compare; + typedef etlstd::less::value_type> compare; return private_heap::is_heap(first, last - first, compare()); } @@ -741,9 +731,9 @@ namespace std template TIterator1 search(TIterator1 first, TIterator1 last, TIterator2 search_first, TIterator2 search_last) { - typedef ETLSTD::equal_to::value_type> compare; + typedef etlstd::equal_to::value_type> compare; - return ETLSTD::search(first, last, search_first, search_last, compare()); + return etlstd::search(first, last, search_first, search_last, compare()); } } diff --git a/include/etl/stl/alternate/functional.h b/include/etl/stl/alternate/functional.h index 0538eb40..9299bf70 100644 --- a/include/etl/stl/alternate/functional.h +++ b/include/etl/stl/alternate/functional.h @@ -4,17 +4,7 @@ #include "../../platform.h" -#if defined(ETL_IN_UNIT_TEST) - #if !defined(ETLSTD) - #define ETLSTD etlstd - #endif - namespace etlstd -#else - #if !defined(ETLSTD) - #define ETLSTD std - #endif - namespace std -#endif +namespace etlstd { //*************************************************************************** template @@ -78,7 +68,7 @@ //*************************************************************************** template - class binder1st : public ETLSTD::unary_function + class binder1st : public etlstd::unary_function { protected: @@ -112,7 +102,7 @@ //*************************************************************************** template - class binder2nd : public ETLSTD::unary_function + class binder2nd : public etlstd::unary_function { protected: TFunction operation; diff --git a/include/etl/stl/alternate/iterator.h b/include/etl/stl/alternate/iterator.h index 59c8c715..1b6cf1ca 100644 --- a/include/etl/stl/alternate/iterator.h +++ b/include/etl/stl/alternate/iterator.h @@ -37,17 +37,7 @@ SOFTWARE. #include #include "../../type_traits.h" -#if defined(ETL_IN_UNIT_TEST) - #if !defined(ETLSTD) - #define ETLSTD etlstd - #endif namespace etlstd -#else - #if !defined(ETLSTD) - #define ETLSTD std - #endif -namespace std -#endif { //*************************************************************************** // iterator @@ -106,11 +96,11 @@ namespace std template void advance(TIterator& itr, TDistance n) { - advance_helper(itr, n, typename ETLSTD::iterator_traits::iterator_category()); + advance_helper(itr, n, typename etlstd::iterator_traits::iterator_category()); } template - void advance_helper(TIterator& itr, TDistance n, ETLSTD::input_iterator_tag) + void advance_helper(TIterator& itr, TDistance n, etlstd::input_iterator_tag) { while (n--) { @@ -119,7 +109,7 @@ namespace std } template - void advance_helper(TIterator& itr, TDistance n, ETLSTD::output_iterator_tag) + void advance_helper(TIterator& itr, TDistance n, etlstd::output_iterator_tag) { while (n--) { @@ -128,7 +118,7 @@ namespace std } template - void advance_helper(TIterator& itr, TDistance n, ETLSTD::forward_iterator_tag) + void advance_helper(TIterator& itr, TDistance n, etlstd::forward_iterator_tag) { while (n--) { @@ -137,7 +127,7 @@ namespace std } template - void advance_helper(TIterator& itr, TDistance n, ETLSTD::bidirectional_iterator_tag) + void advance_helper(TIterator& itr, TDistance n, etlstd::bidirectional_iterator_tag) { if (n > 0) { @@ -156,7 +146,7 @@ namespace std } template - void advance_helper(TIterator& itr, TDistance n, ETLSTD::random_access_iterator_tag) + void advance_helper(TIterator& itr, TDistance n, etlstd::random_access_iterator_tag) { itr += n; } @@ -164,15 +154,15 @@ namespace std //*************************************************************************** // distance template - typename ETLSTD::iterator_traits::difference_type distance(TIterator first, TIterator last) + typename etlstd::iterator_traits::difference_type distance(TIterator first, TIterator last) { - return distance_helper(first, last, typename ETLSTD::iterator_traits::iterator_category()); + return distance_helper(first, last, typename etlstd::iterator_traits::iterator_category()); } template - typename ETLSTD::iterator_traits::difference_type distance_helper(TIterator first, TIterator last, ETLSTD::input_iterator_tag) + typename etlstd::iterator_traits::difference_type distance_helper(TIterator first, TIterator last, etlstd::input_iterator_tag) { - typename ETLSTD::iterator_traits::difference_type d = 0; + typename etlstd::iterator_traits::difference_type d = 0; while (first != last) { @@ -184,9 +174,9 @@ namespace std } template - typename ETLSTD::iterator_traits::difference_type distance_helper(TIterator first, TIterator last, ETLSTD::forward_iterator_tag) + typename etlstd::iterator_traits::difference_type distance_helper(TIterator first, TIterator last, etlstd::forward_iterator_tag) { - typename ETLSTD::iterator_traits::difference_type d = 0; + typename etlstd::iterator_traits::difference_type d = 0; while (first != last) { @@ -198,9 +188,9 @@ namespace std } template - typename ETLSTD::iterator_traits::difference_type distance_helper(TIterator first, TIterator last, ETLSTD::bidirectional_iterator_tag) + typename etlstd::iterator_traits::difference_type distance_helper(TIterator first, TIterator last, etlstd::bidirectional_iterator_tag) { - typename ETLSTD::iterator_traits::difference_type d = 0; + typename etlstd::iterator_traits::difference_type d = 0; while (first != last) { @@ -212,7 +202,7 @@ namespace std } template - typename ETLSTD::iterator_traits::difference_type distance_helper(TIterator first, TIterator last, ETLSTD::random_access_iterator_tag) + typename etlstd::iterator_traits::difference_type distance_helper(TIterator first, TIterator last, etlstd::random_access_iterator_tag) { return last - first; } @@ -224,11 +214,11 @@ namespace std { public: - typedef typename ETLSTD::iterator_traits::difference_type difference_type; - typedef typename ETLSTD::iterator_traits::value_type value_type; - typedef typename ETLSTD::iterator_traits::pointer pointer; - typedef typename ETLSTD::iterator_traits::reference reference; - typedef typename ETLSTD::iterator_traits::iterator_category iterator_category; + typedef typename etlstd::iterator_traits::difference_type difference_type; + typedef typename etlstd::iterator_traits::value_type value_type; + typedef typename etlstd::iterator_traits::pointer pointer; + typedef typename etlstd::iterator_traits::reference reference; + typedef typename etlstd::iterator_traits::iterator_category iterator_category; reverse_iterator() { diff --git a/include/etl/stl/alternate/limits.h b/include/etl/stl/alternate/limits.h index 5d9677d5..85d7a485 100644 --- a/include/etl/stl/alternate/limits.h +++ b/include/etl/stl/alternate/limits.h @@ -42,17 +42,7 @@ SOFTWARE. #define ETL_LOG2(x) (((x) * 301) / 1000) -#if defined(ETL_IN_UNIT_TEST) - #if !defined(ETLSTD) - #define ETLSTD etlstd - #endif - namespace etlstd -#else - #if !defined(ETLSTD) - #define ETLSTD std - #endif - namespace std -#endif +namespace etlstd { template class numeric_limits; diff --git a/include/etl/stl/alternate/utility.h b/include/etl/stl/alternate/utility.h index ab4a66a2..9d3f0d5a 100644 --- a/include/etl/stl/alternate/utility.h +++ b/include/etl/stl/alternate/utility.h @@ -34,17 +34,7 @@ SOFTWARE. #include "../../platform.h" #include "../../type_traits.h" -#if defined(ETL_IN_UNIT_TEST) - #if !defined(ETLSTD) - #define ETLSTD etlstd - #endif - namespace etlstd -#else - #if !defined(ETLSTD) - #define ETLSTD std - #endif - namespace std -#endif +namespace etlstd { //****************************************************************************** template diff --git a/include/etl/stl/choose_namespace.h b/include/etl/stl/choose_namespace.h new file mode 100644 index 00000000..24efde65 --- /dev/null +++ b/include/etl/stl/choose_namespace.h @@ -0,0 +1,46 @@ +///\file + +/****************************************************************************** +The MIT License(MIT) + +Embedded Template Library. +https://github.com/ETLCPP/etl +https://www.etlcpp.com + +Copyright(c) 2019 jwellbelove + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files(the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and / or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions : + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +******************************************************************************/ + +#ifndef ETL_STL_CHOOSE_NAMESPACE_INCLUDED +#define ETL_STL_CHOOSE_NAMESPACE_INCLUDED + +#include "../platform.h" + +#if defined(ETL_NO_STL) + #ifndef ETLSTD + #define ETLSTD etlstd + #endif +#else + #ifndef ETLSTD + #define ETLSTD std + #endif +#endif + +#endif diff --git a/include/etl/stl/functional.h b/include/etl/stl/functional.h index f3fd0034..3d39d883 100644 --- a/include/etl/stl/functional.h +++ b/include/etl/stl/functional.h @@ -3,6 +3,7 @@ #define ETL_STL_FUNCTIONAL_INCLUDED #include "../platform.h" +#include "choose_namespace.h" #if defined(ETL_NO_STL) #include "alternate/functional.h" diff --git a/include/etl/stl/iterator.h b/include/etl/stl/iterator.h index 56f2e5d6..480414d1 100644 --- a/include/etl/stl/iterator.h +++ b/include/etl/stl/iterator.h @@ -33,6 +33,7 @@ SOFTWARE. #define ETL_STL_ITERATOR_INCLUDED #include "../platform.h" +#include "choose_namespace.h" #if defined(ETL_NO_STL) #include "alternate/iterator.h" diff --git a/include/etl/stl/limits.h b/include/etl/stl/limits.h index 6a0ce1d4..e5b23290 100644 --- a/include/etl/stl/limits.h +++ b/include/etl/stl/limits.h @@ -32,6 +32,7 @@ SOFTWARE. #define ETL_STL_LIMITS_INCLUDED #include "../platform.h" +#include "choose_namespace.h" #if defined(ETL_NO_STL) #include "alternate/limits.h" diff --git a/include/etl/stl/utility.h b/include/etl/stl/utility.h index 24a5990f..4737a71f 100644 --- a/include/etl/stl/utility.h +++ b/include/etl/stl/utility.h @@ -32,6 +32,7 @@ SOFTWARE. #define ETL_STL_UTILITY_INCLUDED #include "../platform.h" +#include "choose_namespace.h" #if defined(ETL_NO_STL) #include "alternate/utility.h" diff --git a/include/etl/string_view.h b/include/etl/string_view.h index b8ada876..d9a73748 100644 --- a/include/etl/string_view.h +++ b/include/etl/string_view.h @@ -109,7 +109,7 @@ namespace etl typedef const T& const_reference; typedef const T* const_pointer; typedef const T* const_iterator; - typedef std::reverse_iterator const_reverse_iterator; + typedef ETLSTD::reverse_iterator const_reverse_iterator; enum { @@ -313,7 +313,7 @@ namespace etl void assign(TIterator begin_, TIterator end_) { mbegin = etl::addressof(*begin_); - mend = etl::addressof(*begin_) + std::distance(begin_, end_); + mend = etl::addressof(*begin_) + ETLSTD::distance(begin_, end_); } //************************************************************************* @@ -351,8 +351,8 @@ namespace etl //************************************************************************* void swap(basic_string_view& other) { - std::swap(mbegin, other.mbegin); - std::swap(mend, other.mend); + ETLSTD::swap(mbegin, other.mbegin); + ETLSTD::swap(mend, other.mend); } //************************************************************************* @@ -364,9 +364,9 @@ namespace etl if (position < size()) { - n = std::min(count, size() - position); + n = ETLSTD::min(count, size() - position); - std::copy(mbegin + position, mbegin + position + n, destination); + ETLSTD::copy(mbegin + position, mbegin + position + n, destination); } return n; @@ -381,7 +381,7 @@ namespace etl if (position < size()) { - size_t n = std::min(count, size() - position); + size_t n = ETLSTD::min(count, size() - position); view = basic_string_view(mbegin + position, mbegin + position + n); } @@ -495,7 +495,7 @@ namespace etl return npos; } - const_iterator iposition = std::search(begin() + position, end(), view.begin(), view.end()); + const_iterator iposition = ETLSTD::search(begin() + position, end(), view.begin(), view.end()); if (iposition == end()) { @@ -503,7 +503,7 @@ namespace etl } else { - return std::distance(begin(), iposition); + return ETLSTD::distance(begin(), iposition); } } @@ -532,9 +532,9 @@ namespace etl return npos; } - position = std::min(position, size()); + position = ETLSTD::min(position, size()); - const_iterator iposition = std::find_end(begin(), + const_iterator iposition = ETLSTD::find_end(begin(), begin() + position, view.begin(), view.end()); @@ -545,7 +545,7 @@ namespace etl } else { - return std::distance(begin(), iposition); + return ETLSTD::distance(begin(), iposition); } } @@ -615,7 +615,7 @@ namespace etl return npos; } - position = std::min(position, size() - 1); + position = ETLSTD::min(position, size() - 1); const_reverse_iterator it = rbegin() + size() - position - 1; @@ -711,7 +711,7 @@ namespace etl return npos; } - position = std::min(position, size() - 1); + position = ETLSTD::min(position, size() - 1); const_reverse_iterator it = rbegin() + size() - position - 1; @@ -762,7 +762,7 @@ namespace etl friend bool operator == (const etl::basic_string_view& lhs, const etl::basic_string_view& rhs) { return (lhs.size() == rhs.size()) && - std::equal(lhs.begin(), lhs.end(), rhs.begin()); + ETLSTD::equal(lhs.begin(), lhs.end(), rhs.begin()); } //************************************************************************* @@ -778,7 +778,7 @@ namespace etl //************************************************************************* friend bool operator < (const etl::basic_string_view& lhs, const etl::basic_string_view& rhs) { - return std::lexicographical_compare(lhs.begin(), lhs.end(), rhs.begin(), rhs.end()); + return ETLSTD::lexicographical_compare(lhs.begin(), lhs.end(), rhs.begin(), rhs.end()); } //************************************************************************* diff --git a/include/etl/task.h b/include/etl/task.h index 1e25336d..a1dedf51 100644 --- a/include/etl/task.h +++ b/include/etl/task.h @@ -3,7 +3,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl -http://www.etlcpp.com +https://www.etlcpp.com Copyright(c) 2017 jwellbelove diff --git a/include/etl/type_def.h b/include/etl/type_def.h index 15065525..7b8cb2b9 100644 --- a/include/etl/type_def.h +++ b/include/etl/type_def.h @@ -5,7 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl -http://www.etlcpp.com +https://www.etlcpp.com Copyright(c) 2016 jwellbelove diff --git a/include/etl/type_traits.h b/include/etl/type_traits.h index 77216e90..8469f4cc 100644 --- a/include/etl/type_traits.h +++ b/include/etl/type_traits.h @@ -513,14 +513,14 @@ namespace etl ///\ingroup types //*************************************************************************** template struct is_one_of { - static const bool value = + static const bool value = etl::is_same::value || etl::is_same::value || etl::is_same::value || diff --git a/include/etl/u16string.h b/include/etl/u16string.h index 659a4aac..a60e007f 100644 --- a/include/etl/u16string.h +++ b/include/etl/u16string.h @@ -5,7 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl -http://www.etlcpp.com +https://www.etlcpp.com Copyright(c) 2016 jwellbelove @@ -180,7 +180,7 @@ namespace etl { ETL_ASSERT(position < size(), ETL_ERROR(string_out_of_bounds)); - length_ = std::min(length_, size() - position); + length_ = ETLSTD::min(length_, size() - position); new_string.assign(buffer + position, buffer + position + length_); } diff --git a/include/etl/u32string.h b/include/etl/u32string.h index 70826841..3adcda6d 100644 --- a/include/etl/u32string.h +++ b/include/etl/u32string.h @@ -5,7 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl -http://www.etlcpp.com +https://www.etlcpp.com Copyright(c) 2016 jwellbelove @@ -180,7 +180,7 @@ namespace etl { ETL_ASSERT(position < size(), ETL_ERROR(string_out_of_bounds)); - length_ = std::min(length_, size() - position); + length_ = ETLSTD::min(length_, size() - position); new_string.assign(buffer + position, buffer + position + length_); } diff --git a/include/etl/unordered_map.h b/include/etl/unordered_map.h index 355173ed..36822890 100644 --- a/include/etl/unordered_map.h +++ b/include/etl/unordered_map.h @@ -481,7 +481,7 @@ namespace etl local_iterator inode; }; - typedef typename std::iterator_traits::difference_type difference_type; + typedef typename ETLSTD::iterator_traits::difference_type difference_type; //********************************************************************* /// Returns an iterator to the beginning of the unordered_map. diff --git a/include/etl/unordered_multimap.h b/include/etl/unordered_multimap.h index 8eb08512..ff074ccd 100644 --- a/include/etl/unordered_multimap.h +++ b/include/etl/unordered_multimap.h @@ -481,7 +481,7 @@ namespace etl local_iterator inode; }; - typedef typename std::iterator_traits::difference_type difference_type; + typedef typename ETLSTD::iterator_traits::difference_type difference_type; //********************************************************************* /// Returns an iterator to the beginning of the unordered_multimap. diff --git a/include/etl/unordered_multiset.h b/include/etl/unordered_multiset.h index b40c415e..7ec1c2e6 100644 --- a/include/etl/unordered_multiset.h +++ b/include/etl/unordered_multiset.h @@ -476,7 +476,7 @@ namespace etl local_iterator inode; }; - typedef typename std::iterator_traits::difference_type difference_type; + typedef typename ETLSTD::iterator_traits::difference_type difference_type; //********************************************************************* /// Returns an iterator to the beginning of the unordered_multiset. diff --git a/include/etl/unordered_set.h b/include/etl/unordered_set.h index 49313116..009428b6 100644 --- a/include/etl/unordered_set.h +++ b/include/etl/unordered_set.h @@ -477,7 +477,7 @@ namespace etl local_iterator inode; }; - typedef typename std::iterator_traits::difference_type difference_type; + typedef typename ETLSTD::iterator_traits::difference_type difference_type; //********************************************************************* /// Returns an iterator to the beginning of the unordered_set. diff --git a/include/etl/user_type.h b/include/etl/user_type.h index 5b7c3e32..112cdb29 100644 --- a/include/etl/user_type.h +++ b/include/etl/user_type.h @@ -5,7 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl -http://www.etlcpp.com +https://www.etlcpp.com Copyright(c) 2017 jwellbelove diff --git a/include/etl/utility.h b/include/etl/utility.h index 05e4a569..1743c01c 100644 --- a/include/etl/utility.h +++ b/include/etl/utility.h @@ -5,7 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl -http://www.etlcpp.com +https://www.etlcpp.com Copyright(c) 2016 jwellbelove diff --git a/include/etl/vector.h b/include/etl/vector.h index bc0a0236..cd7e0373 100644 --- a/include/etl/vector.h +++ b/include/etl/vector.h @@ -92,10 +92,10 @@ namespace etl typedef const T* const_pointer; typedef T* iterator; typedef const T* const_iterator; - typedef std::reverse_iterator reverse_iterator; - typedef std::reverse_iterator const_reverse_iterator; + typedef ETLSTD::reverse_iterator reverse_iterator; + typedef ETLSTD::reverse_iterator const_reverse_iterator; typedef size_t size_type; - typedef typename std::iterator_traits::difference_type difference_type; + typedef typename ETLSTD::iterator_traits::difference_type difference_type; protected: @@ -365,7 +365,7 @@ namespace etl template void assign(TIterator first, TIterator last) { - ETL_STATIC_ASSERT((etl::is_same::type, typename etl::remove_cv::value_type>::type>::value), "Iterator type does not match container type"); + ETL_STATIC_ASSERT((etl::is_same::type, typename etl::remove_cv::value_type>::type>::value), "Iterator type does not match container type"); #if defined(ETL_DEBUG) difference_type d = std::distance(first, last); diff --git a/include/etl/version.h b/include/etl/version.h index e678618d..58d4ef68 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 34 -#define ETL_VERSION_PATCH 1 +#define ETL_VERSION_MINOR 35 +#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_STRINGIFY(ETL_VERSION_MAJOR) L"." ETL_STRINGIFY(ETL_VERSION_MINOR) L"." ETL_STRINGIFY(ETL_VERSION_PATCH) diff --git a/include/etl/visitor.h b/include/etl/visitor.h index 3273eb68..08212225 100644 --- a/include/etl/visitor.h +++ b/include/etl/visitor.h @@ -5,7 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl -http://www.etlcpp.com +https://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/include/etl/wstring.h b/include/etl/wstring.h index 28b55b54..07e0a0e2 100644 --- a/include/etl/wstring.h +++ b/include/etl/wstring.h @@ -5,7 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl -http://www.etlcpp.com +https://www.etlcpp.com Copyright(c) 2016 jwellbelove @@ -57,7 +57,7 @@ namespace etl typedef iwstring base_type; typedef iwstring interface_type; - + typedef iwstring::value_type value_type; static const size_t MAX_SIZE = MAX_SIZE_; @@ -181,7 +181,7 @@ namespace etl { ETL_ASSERT(position < size(), ETL_ERROR(string_out_of_bounds)); - length_ = std::min(length_, size() - position); + length_ = ETLSTD::min(length_, size() - position); new_string.assign(buffer + position, buffer + position + length_); } diff --git a/library.json b/library.json index 132ee71e..65c3e4b4 100644 --- a/library.json +++ b/library.json @@ -1,6 +1,6 @@ { "name": "Embedded Template Library", - "version": "14.34.1", + "version": "14.35.0", "authors": { "name": "John Wellbelove", "email": "" diff --git a/library.properties b/library.properties index fb32e213..08ec01f7 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=Embedded Template Library -version=14.34.1 +version=14.35.0 author= John Wellbelove maintainer=John Wellbelove license=MIT diff --git a/support/Release notes.txt b/support/Release notes.txt index 589409aa..c992de32 100644 --- a/support/Release notes.txt +++ b/support/Release notes.txt @@ -1,3 +1,7 @@ +=============================================================================== +14.35.0 +Changed namespace for alternate ETL's STL support. + =============================================================================== 14.34.1 Fixed strict aliasing bug for -O3 optimisation in etl::pool diff --git a/test/test_bsd_checksum.cpp b/test/test_bsd_checksum.cpp index 0197d3cf..9829441c 100644 --- a/test/test_bsd_checksum.cpp +++ b/test/test_bsd_checksum.cpp @@ -40,7 +40,7 @@ namespace template TSum reference_checksum(TIterator begin, TIterator end) { - typedef typename std::iterator_traits::value_type value_type; + typedef typename ETLSTD::iterator_traits::value_type value_type; TSum checksum = 0; while (begin != end) diff --git a/test/test_unordered_map.cpp b/test/test_unordered_map.cpp index fb03c947..472b895e 100644 --- a/test/test_unordered_map.cpp +++ b/test/test_unordered_map.cpp @@ -3,7 +3,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl -http://www.etlcpp.com +https://www.etlcpp.com Copyright(c) 2016 jwellbelove @@ -700,13 +700,13 @@ namespace auto it = map.find(1); map.erase(it); - + it = map.find(4); map.erase(it); std::vector s; - for (const auto &kv : map) + for (const auto &kv : map) { std::stringstream ss; ss << "map[" << kv.first << "] = " << kv.second; diff --git a/test/test_visitor.cpp b/test/test_visitor.cpp index befc438d..95530c9b 100644 --- a/test/test_visitor.cpp +++ b/test/test_visitor.cpp @@ -3,7 +3,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl -http://www.etlcpp.com +https://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/test/test_xor_checksum.cpp b/test/test_xor_checksum.cpp index 207d2699..690a2090 100644 --- a/test/test_xor_checksum.cpp +++ b/test/test_xor_checksum.cpp @@ -40,7 +40,7 @@ namespace template TSum reference_checksum(TIterator begin, TIterator end) { - typedef typename std::iterator_traits::value_type value_type; + typedef typename ETLSTD::iterator_traits::value_type value_type; TSum checksum = 0; while (begin != end) diff --git a/test/test_xor_rotate_checksum.cpp b/test/test_xor_rotate_checksum.cpp index 485f9972..3ce76861 100644 --- a/test/test_xor_rotate_checksum.cpp +++ b/test/test_xor_rotate_checksum.cpp @@ -40,7 +40,7 @@ namespace template TSum reference_checksum(TIterator begin, TIterator end) { - typedef typename std::iterator_traits::value_type value_type; + typedef typename ETLSTD::iterator_traits::value_type value_type; TSum checksum = 0; while (begin != end) diff --git a/test/vs2017/etl.vcxproj b/test/vs2017/etl.vcxproj index 885cf35f..d97dbef2 100644 --- a/test/vs2017/etl.vcxproj +++ b/test/vs2017/etl.vcxproj @@ -517,6 +517,7 @@ + diff --git a/test/vs2017/etl.vcxproj.filters b/test/vs2017/etl.vcxproj.filters index 28d605f7..986060f8 100644 --- a/test/vs2017/etl.vcxproj.filters +++ b/test/vs2017/etl.vcxproj.filters @@ -783,6 +783,9 @@ ETL\Profiles + + ETL\STL +