diff --git a/examples/ArmTimerCallbacks - C++/ArmTimerCallbacks.uvprojx b/examples/ArmTimerCallbacks - C++/ArmTimerCallbacks.uvprojx
index f89a79e0..7b7077f4 100644
--- a/examples/ArmTimerCallbacks - C++/ArmTimerCallbacks.uvprojx
+++ b/examples/ArmTimerCallbacks - C++/ArmTimerCallbacks.uvprojx
@@ -11,7 +11,7 @@
0x4
ARM-ADS
6130001::V6.13.1::.\ARMCLANG
- 1
+ 0
STM32F401RETx
@@ -312,7 +312,7 @@
1
- 7
+ 1
0
0
1
@@ -321,7 +321,7 @@
1
0
0
- 3
+ 2
0
0
1
diff --git a/include/etl/absolute.h b/include/etl/absolute.h
index ba7f69ea..165dba9c 100644
--- a/include/etl/absolute.h
+++ b/include/etl/absolute.h
@@ -39,7 +39,7 @@ namespace etl
// For signed types.
//***************************************************************************
template
- typename etlstd::enable_if::value, T>::type
+ typename etl::enable_if::value, T>::type
absolute(T value)
{
return (value < T(0)) ? -value : value;
@@ -49,7 +49,7 @@ namespace etl
// For unsigned types.
//***************************************************************************
template
- typename etlstd::enable_if::value, T>::type
+ typename etl::enable_if::value, T>::type
absolute(T value)
{
return value;
diff --git a/include/etl/algorithm.h b/include/etl/algorithm.h
index 788223ec..7d6797ab 100644
--- a/include/etl/algorithm.h
+++ b/include/etl/algorithm.h
@@ -37,6 +37,7 @@ SOFTWARE.
///\ingroup utilities
#include
+#include
#include "platform.h"
#include "type_traits.h"
@@ -55,20 +56,20 @@ SOFTWARE.
//*****************************************************************************
// Algorithms defined by the ETL
//*****************************************************************************
-#undef ETL_ALGORITHM
-
-namespace etlstd
+namespace etl
{
-#if defined(ETL_NO_STL)
+// We can't have std::swap and etl::swap templates coexisting in the unit tests
+// as the compiler will be unable to decide of which one to use, due to ADL.
+#if defined(ETL_NO_STL) && !defined(ETL_IN_UNIT_TEST)
//***************************************************************************
// swap
#if ETL_CPP11_SUPPORTED
template
void swap(T& a, T& b)
{
- T temp(etlstd::move(a));
- a = etlstd::move(b);
- b = etlstd::move(temp);
+ T temp(etl::move(a));
+ a = etl::move(b);
+ b = etl::move(temp);
}
#else
template
@@ -79,15 +80,6 @@ namespace etlstd
b = temp;
}
#endif
-#else
- //***************************************************************************
- // swap
- template
- void swap(T& a, T& b)
- {
- using std::swap;
- swap(a, b);
- }
#endif
#if defined(ETL_NO_STL)
@@ -96,7 +88,7 @@ namespace etlstd
template
void iter_swap(TIterator1 a, TIterator2 b)
{
- typename etlstd::iterator_traits::value_type c = *a;
+ typename etl::iterator_traits::value_type c = *a;
*a = *b;
*b = c;
}
@@ -142,13 +134,13 @@ namespace etlstd
// copy
// Pointer
template
- typename etlstd::enable_if::value &&
- etlstd::is_pointer::value &&
- etlstd::is_pod::value_type>::value, TIterator2>::type
+ typename etl::enable_if::value &&
+ etl::is_pointer::value &&
+ 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::difference_type difference_t;
+ typedef typename etl::iterator_traits::value_type value_t;
+ typedef typename etl::iterator_traits::difference_type difference_t;
difference_t count = (se - sb);
@@ -157,9 +149,9 @@ namespace etlstd
// Other iterator
template
- typename etlstd::enable_if::value ||
- !etlstd::is_pointer::value ||
- !etlstd::is_pod::value_type>::value, TIterator2>::type
+ typename etl::enable_if::value ||
+ !etl::is_pointer::value ||
+ !etl::is_pod::value_type>::value, TIterator2>::type
copy(TIterator1 sb, TIterator1 se, TIterator2 db)
{
while (sb != se)
@@ -207,21 +199,21 @@ namespace etlstd
// copy_n
// Pointer
template
- typename etlstd::enable_if::value &&
- etlstd::is_pointer::value &&
- etlstd::is_pod::value_type>::value, TIterator2>::type
+ typename etl::enable_if::value &&
+ etl::is_pointer::value &&
+ 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 etl::iterator_traits::value_type value_t;
return TIterator2(memmove(db, sb, sizeof(value_t) * count)) + count;
}
// Other iterator
template
- typename etlstd::enable_if::value ||
- !etlstd::is_pointer::value ||
- !etlstd::is_pod::value_type>::value, TIterator2>::type
+ typename etl::enable_if::value ||
+ !etl::is_pointer::value ||
+ !etl::is_pod::value_type>::value, TIterator2>::type
copy_n(TIterator1 sb, TSize count, TIterator2 db)
{
while (count != 0)
@@ -252,12 +244,12 @@ namespace etlstd
// copy_backward
// Pointer
template
- typename etlstd::enable_if::value &&
- etlstd::is_pointer::value &&
- etlstd::is_pod::value_type>::value, TIterator2>::type
+ typename etl::enable_if::value &&
+ etl::is_pointer::value &&
+ 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 etl::iterator_traits::value_type value_t;
const size_t length = (se - sb);
@@ -266,9 +258,9 @@ namespace etlstd
// Other iterator
template
- typename etlstd::enable_if::value ||
- !etlstd::is_pointer::value ||
- !etlstd::is_pod::value_type>::value, TIterator2>::type
+ typename etl::enable_if::value ||
+ !etl::is_pointer::value ||
+ !etl::is_pod::value_type>::value, TIterator2>::type
copy_backward(TIterator1 sb, TIterator1 se, TIterator2 de)
{
while (se != sb)
@@ -296,7 +288,7 @@ namespace etlstd
{
while (sb != se)
{
- *db++ = etlstd::move(*sb++);
+ *db++ = etl::move(*sb++);
}
return db;
@@ -319,7 +311,7 @@ namespace etlstd
{
while (sb != se)
{
- *(--de) = etlstd::move(*(--se));
+ *(--de) = etl::move(*(--se));
}
return de;
@@ -339,14 +331,14 @@ namespace etlstd
// reverse
// Pointers
template
- typename etlstd::enable_if::value, void>::type
+ typename etl::enable_if::value, void>::type
reverse(TIterator b, TIterator e)
{
if (b != e)
{
while (b < --e)
{
- etlstd::iter_swap(b, e);
+ etl::iter_swap(b, e);
++b;
}
}
@@ -354,12 +346,12 @@ namespace etlstd
// Other
template
- typename etlstd::enable_if::value, void>::type
+ typename etl::enable_if::value, void>::type
reverse(TIterator b, TIterator e)
{
while ((b != e) && (b != --e))
{
- etlstd::iter_swap(b++, e);
+ etl::iter_swap(b++, e);
}
}
#else
@@ -376,18 +368,19 @@ namespace etlstd
//***************************************************************************
// lower_bound
template
+ ETL_NODISCARD
TIterator lower_bound(TIterator first, TIterator last, const TValue& value, TCompare compare)
{
- typedef typename etlstd::iterator_traits::difference_type difference_t;
+ typedef typename etl::iterator_traits::difference_type difference_t;
- difference_t count = etlstd::distance(first, last);
+ difference_t count = etl::distance(first, last);
while (count > 0)
{
TIterator itr = first;
difference_t step = count / 2;
- etlstd::advance(itr, step);
+ etl::advance(itr, step);
if (compare(*itr, value))
{
@@ -404,22 +397,25 @@ namespace etlstd
}
template
+ ETL_NODISCARD
TIterator lower_bound(TIterator first, TIterator last, const TValue& value)
{
- typedef etlstd::less::value_type> compare;
+ typedef etl::less::value_type> compare;
- return etlstd::lower_bound(first, last, value, compare());
+ return etl::lower_bound(first, last, value, compare());
}
#else
//***************************************************************************
// lower_bound
template
+ ETL_NODISCARD
TIterator lower_bound(TIterator first, TIterator last, const TValue& value, TCompare compare)
{
return std::lower_bound(first, last, value, compare);
}
template
+ ETL_NODISCARD
TIterator lower_bound(TIterator first, TIterator last, const TValue& value)
{
return std::lower_bound(first, last, value);
@@ -430,18 +426,19 @@ namespace etlstd
//***************************************************************************
// upper_bound
template
+ ETL_NODISCARD
TIterator upper_bound(TIterator first, TIterator last, const TValue& value, TCompare compare)
{
- typedef typename etlstd::iterator_traits::difference_type difference_t;
+ typedef typename etl::iterator_traits::difference_type difference_t;
- difference_t count = etlstd::distance(first, last);
+ difference_t count = etl::distance(first, last);
while (count > 0)
{
TIterator itr = first;
difference_t step = count / 2;
- etlstd::advance(itr, step);
+ etl::advance(itr, step);
if (!compare(value, *itr))
{
@@ -458,22 +455,25 @@ namespace etlstd
}
template
+ ETL_NODISCARD
TIterator upper_bound(TIterator first, TIterator last, const TValue& value)
{
- typedef etlstd::less::value_type> compare;
+ typedef etl::less::value_type> compare;
- return etlstd::upper_bound(first, last, value, compare());
+ return etl::upper_bound(first, last, value, compare());
}
#else
//***************************************************************************
// upper_bound
template
+ ETL_NODISCARD
TIterator upper_bound(TIterator first, TIterator last, const TValue& value, TCompare compare)
{
return std::upper_bound(first, last, value, compare);
}
template
+ ETL_NODISCARD
TIterator upper_bound(TIterator first, TIterator last, const TValue& value)
{
return std::upper_bound(first, last, value);
@@ -484,30 +484,34 @@ namespace etlstd
//***************************************************************************
// equal_range
template
+ ETL_NODISCARD
ETL_OR_STD::pair equal_range(TIterator first, TIterator last, const TValue& value, TCompare compare)
{
- return ETL_OR_STD::make_pair(etlstd::lower_bound(first, last, value, compare),
- etlstd::upper_bound(first, last, value, compare));
+ return ETL_OR_STD::make_pair(etl::lower_bound(first, last, value, compare),
+ etl::upper_bound(first, last, value, compare));
}
template
+ ETL_NODISCARD
ETL_OR_STD::pair equal_range(TIterator first, TIterator last, const TValue& value)
{
- typedef etlstd::less::value_type> compare;
+ typedef etl::less::value_type> compare;
- return ETL_OR_STD::make_pair(etlstd::lower_bound(first, last, value, compare()),
- etlstd::upper_bound(first, last, value, compare()));
+ return ETL_OR_STD::make_pair(etl::lower_bound(first, last, value, compare()),
+ etl::upper_bound(first, last, value, compare()));
}
#else
//***************************************************************************
// equal_range
template
+ ETL_NODISCARD
std::pair equal_range(TIterator first, TIterator last, const TValue& value, TCompare compare)
{
return std::equal_range(first, last, value, compare);
}
template
+ ETL_NODISCARD
std::pair equal_range(TIterator first, TIterator last, const TValue& value)
{
return std::equal_range(first, last, value);
@@ -518,6 +522,7 @@ namespace etlstd
//***************************************************************************
// find_if
template
+ ETL_NODISCARD
TIterator find_if(TIterator first, TIterator last, TUnaryPredicate predicate)
{
while (first != last)
@@ -536,6 +541,7 @@ namespace etlstd
//***************************************************************************
// find_if
template
+ ETL_NODISCARD
TIterator find_if(TIterator first, TIterator last, TUnaryPredicate predicate)
{
return std::find_if(first, last, predicate);
@@ -546,6 +552,7 @@ namespace etlstd
//***************************************************************************
// find
template
+ ETL_NODISCARD
TIterator find(TIterator first, TIterator last, const T& value)
{
while (first != last)
@@ -564,6 +571,7 @@ namespace etlstd
//***************************************************************************
// find
template
+ ETL_NODISCARD
TIterator find(TIterator first, TIterator last, const T& value)
{
return std::find(first, last, value);
@@ -574,7 +582,7 @@ namespace etlstd
//***************************************************************************
// fill
template
- typename etlstd::enable_if::value || etlstd::is_same::value) || !etlstd::is_pointer::value, void>::type
+ typename etl::enable_if::value || etl::is_same::value) || !etl::is_pointer::value, void>::type
fill(TIterator first, TIterator last, const TValue& value)
{
while (first != last)
@@ -584,7 +592,7 @@ namespace etlstd
}
template
- typename etlstd::enable_if<(etlstd::is_same::value || etlstd::is_same::value) && etlstd::is_pointer::value, void>::type
+ typename etl::enable_if<(etl::is_same::value || etl::is_same::value) && etl::is_pointer::value, void>::type
fill(TIterator first, TIterator last, const TValue& value)
{
memset(first, value, last - first);
@@ -603,7 +611,7 @@ namespace etlstd
//***************************************************************************
// fill_n
template
- typename etlstd::enable_if::value || etlstd::is_same::value) || !etlstd::is_pointer::value, TIterator>::type
+ typename etl::enable_if::value || etl::is_same::value) || !etl::is_pointer::value, TIterator>::type
fill_n(TIterator first, TSize count, const TValue& value)
{
for (TSize i = 0; i < count; ++i)
@@ -615,7 +623,7 @@ namespace etlstd
}
template
- typename etlstd::enable_if<(etlstd::is_same::value || etlstd::is_same::value) && etlstd::is_pointer::value, void>::type
+ typename etl::enable_if<(etl::is_same::value || etl::is_same::value) && etl::is_pointer::value, void>::type
fill_n(TIterator first, TSize count, const TValue& value)
{
memset(first, value, count);
@@ -634,7 +642,8 @@ namespace etlstd
//***************************************************************************
// count
template
- typename etlstd::iterator_traits::difference_type count(TIterator first, TIterator last, const T& value)
+ ETL_NODISCARD
+ typename etl::iterator_traits::difference_type count(TIterator first, TIterator last, const T& value)
{
typename iterator_traits::difference_type n = 0;
@@ -654,6 +663,7 @@ namespace etlstd
//***************************************************************************
// count
template
+ ETL_NODISCARD
typename std::iterator_traits::difference_type count(TIterator first, TIterator last, const T& value)
{
return std::count(first, last, value);
@@ -664,7 +674,8 @@ namespace etlstd
//***************************************************************************
// count_if
template
- typename etlstd::iterator_traits::difference_type count_if(TIterator first, TIterator last, TUnaryPredicate predicate)
+ ETL_NODISCARD
+ typename etl::iterator_traits::difference_type count_if(TIterator first, TIterator last, TUnaryPredicate predicate)
{
typename iterator_traits::difference_type n = 0;
@@ -684,6 +695,7 @@ namespace etlstd
//***************************************************************************
// count_if
template
+ ETL_NODISCARD
typename std::iterator_traits::difference_type count_if(TIterator first, TIterator last, TUnaryPredicate predicate)
{
return std::count_if(first, last, predicate);
@@ -694,7 +706,8 @@ namespace etlstd
//***************************************************************************
// equal
template
- typename etlstd::enable_if::value || !etlstd::is_pointer::value || !etlstd::is_pod::value_type>::value, bool>::type
+ ETL_NODISCARD
+ 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)
@@ -709,10 +722,11 @@ namespace etlstd
}
template
- typename etlstd::enable_if::value && etlstd::is_pointer::value && etlstd::is_pod::value_type>::value, bool>::type
+ ETL_NODISCARD
+ 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 etl::iterator_traits::value_type value_t;
return (memcmp(first1, first2, sizeof(value_t) * (last1 - first1)) == 0);
}
@@ -720,6 +734,7 @@ namespace etlstd
//***************************************************************************
// equal
template
+ ETL_NODISCARD
bool equal(TIterator1 first1, TIterator1 last1, TIterator2 first2)
{
return std::equal(first1, last1, first2);
@@ -730,6 +745,7 @@ namespace etlstd
//***************************************************************************
// lexicographical_compare
template
+ ETL_NODISCARD
bool lexicographical_compare(TIterator1 first1, TIterator1 last1,
TIterator2 first2, TIterator2 last2,
TCompare compare)
@@ -756,17 +772,19 @@ namespace etlstd
//***************************************************************************
// lexicographical_compare
template
+ ETL_NODISCARD
bool lexicographical_compare(TIterator1 first1, TIterator1 last1,
TIterator2 first2, TIterator2 last2)
{
- typedef etlstd::less::value_type> compare;
+ typedef etl::less::value_type> compare;
- return etlstd::lexicographical_compare(first1, last1, first2, last2, compare());
+ return etl::lexicographical_compare(first1, last1, first2, last2, compare());
}
#else
//***************************************************************************
// lexicographical_compare
template
+ ETL_NODISCARD
bool lexicographical_compare(TIterator1 first1, TIterator1 last1,
TIterator2 first2, TIterator2 last2,
TCompare compare)
@@ -777,6 +795,7 @@ namespace etlstd
//***************************************************************************
// lexicographical_compare
template
+ ETL_NODISCARD
bool lexicographical_compare(TIterator1 first1, TIterator1 last1,
TIterator2 first2, TIterator2 last2)
{
@@ -788,28 +807,32 @@ namespace etlstd
//***************************************************************************
// min
template
+ ETL_NODISCARD
ETL_CONSTEXPR const T& min(const T& a, const T& b, TCompare compare)
{
return (compare(a, b)) ? a : b;
}
template
+ ETL_NODISCARD
ETL_CONSTEXPR const T& min(const T& a, const T& b)
{
- typedef etlstd::less compare;
+ typedef etl::less compare;
- return etlstd::min(a, b, compare());
+ return etl::min(a, b, compare());
}
#else
//***************************************************************************
// min
template
+ ETL_NODISCARD
ETL_CONSTEXPR const T& min(const T& a, const T& b, TCompare compare)
{
return std::min(a, b, compare);
}
template
+ ETL_NODISCARD
ETL_CONSTEXPR const T& min(const T& a, const T& b)
{
return std::min(a, b);
@@ -820,28 +843,32 @@ namespace etlstd
//***************************************************************************
// max
template
+ ETL_NODISCARD
ETL_CONSTEXPR const T& max(const T& a, const T& b, TCompare compare)
{
return (compare(a, b)) ? b : a;
}
template
+ ETL_NODISCARD
ETL_CONSTEXPR const T& max(const T& a, const T& b)
{
- typedef etlstd::less compare;
+ typedef etl::less compare;
- return etlstd::max(a, b, compare());
+ return etl::max(a, b, compare());
}
#else
//***************************************************************************
// max
template
+ ETL_NODISCARD
ETL_CONSTEXPR const T& max(const T& a, const T& b, TCompare compare)
{
return std::max(a, b, compare);
}
template
+ ETL_NODISCARD
ETL_CONSTEXPR const T& max(const T& a, const T& b)
{
return std::max(a, b);
@@ -964,8 +991,8 @@ namespace etlstd
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 etl::iterator_traits::value_type value_t;
+ typedef typename etl::iterator_traits::difference_type distance_t;
value_t value = last[-1];
last[-1] = first[0];
@@ -977,17 +1004,17 @@ namespace etlstd
template
void pop_heap(TIterator first, TIterator last)
{
- typedef etlstd::less::value_type> compare;
+ typedef etl::less::value_type> compare;
- etlstd::pop_heap(first, last, compare());
+ etl::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 etl::iterator_traits::difference_type difference_t;
+ typedef typename etl::iterator_traits::value_type value_t;
private_heap::push_heap(first, difference_t(last - first - 1), difference_t(0), value_t(*(last - 1)), compare);
}
@@ -996,16 +1023,16 @@ namespace etlstd
template
void push_heap(TIterator first, TIterator last)
{
- typedef etlstd::less::value_type> compare;
+ typedef etl::less::value_type> compare;
- etlstd::push_heap(first, last, compare());
+ etl::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 etl::iterator_traits::difference_type difference_t;
if ((last - first) < 2)
{
@@ -1032,22 +1059,24 @@ namespace etlstd
template
void make_heap(TIterator first, TIterator last)
{
- typedef etlstd::less::value_type> compare;
+ typedef etl::less::value_type> compare;
- etlstd::make_heap(first, last, compare());
+ etl::make_heap(first, last, compare());
}
// Is Heap
template
+ ETL_NODISCARD
bool is_heap(TIterator first, TIterator last)
{
- typedef etlstd::less::value_type> compare;
+ typedef etl::less::value_type> compare;
return private_heap::is_heap(first, last - first, compare());
}
// Is Heap
template
+ ETL_NODISCARD
bool is_heap(TIterator first, TIterator last, TCompare compare)
{
return private_heap::is_heap(first, last - first, compare);
@@ -1099,6 +1128,7 @@ namespace etlstd
// Is Heap
template
+ ETL_NODISCARD
bool is_heap(TIterator first, TIterator last)
{
return std::is_heap(first, last);
@@ -1106,6 +1136,7 @@ namespace etlstd
// Is Heap
template
+ ETL_NODISCARD
bool is_heap(TIterator first, TIterator last, TCompare compare)
{
return std::is_heap(first, last, compare);
@@ -1116,6 +1147,7 @@ namespace etlstd
//***************************************************************************
// Search
template
+ ETL_NODISCARD
TIterator1 search(TIterator1 first, TIterator1 last, TIterator2 search_first, TIterator2 search_last, TCompare compare)
{
while (true)
@@ -1150,16 +1182,18 @@ namespace etlstd
// Search
template
+ ETL_NODISCARD
TIterator1 search(TIterator1 first, TIterator1 last, TIterator2 search_first, TIterator2 search_last)
{
- typedef etlstd::equal_to::value_type> compare;
+ typedef etl::equal_to::value_type> compare;
- return etlstd::search(first, last, search_first, search_last, compare());
+ return etl::search(first, last, search_first, search_last, compare());
}
#else
//***************************************************************************
// Search
template
+ ETL_NODISCARD
TIterator1 search(TIterator1 first, TIterator1 last, TIterator2 search_first, TIterator2 search_last, TCompare compare)
{
return std::search(first, last, search_first, search_last, compare);
@@ -1167,6 +1201,7 @@ namespace etlstd
// Search
template
+ ETL_NODISCARD
TIterator1 search(TIterator1 first, TIterator1 last, TIterator2 search_first, TIterator2 search_last)
{
return std::search(first, last, search_first, search_last);
@@ -1179,16 +1214,14 @@ namespace etlstd
template
TIterator rotate(TIterator first, TIterator middle, TIterator last)
{
-#if defined(ETL_NO_STL)
- using etlstd::swap;
-#else
- using std::swap;
-#endif
+ using ETL_OR_STD::swap; // Allow ADL
TIterator next = middle;
while (first != next)
{
+ using ETL_OR_STD::swap;
+
swap(*first++, *next++);
if (next == last)
@@ -1218,6 +1251,7 @@ namespace etlstd
// find_end
// Predicate
template
+ ETL_NODISCARD
TIterator1 find_end(TIterator1 b, TIterator1 e,
TIterator2 sb, TIterator2 se,
TPredicate predicate)
@@ -1231,7 +1265,7 @@ namespace etlstd
while (true)
{
- TIterator1 new_result = etlstd::search(b, e, sb, se, predicate);
+ TIterator1 new_result = etl::search(b, e, sb, se, predicate);
if (new_result == e)
{
@@ -1249,10 +1283,11 @@ namespace etlstd
// Default
template
+ ETL_NODISCARD
TIterator1 find_end(TIterator1 b, TIterator1 e,
TIterator2 sb, TIterator2 se)
{
- typedef etlstd::equal_to::value_type> predicate;
+ typedef etl::equal_to::value_type> predicate;
return find_end(b, e, sb, se, predicate());
}
@@ -1261,6 +1296,7 @@ namespace etlstd
// find_end
// Predicate
template
+ ETL_NODISCARD
TIterator1 find_end(TIterator1 b, TIterator1 e,
TIterator2 sb, TIterator2 se,
TPredicate predicate)
@@ -1270,6 +1306,7 @@ namespace etlstd
// Default
template
+ ETL_NODISCARD
TIterator1 find_end(TIterator1 b, TIterator1 e,
TIterator2 sb, TIterator2 se)
{
@@ -1284,6 +1321,7 @@ namespace etlstd
///\ingroup algorithm
//***************************************************************************
template
+ ETL_NODISCARD
ETL_OR_STD::pair minmax_element(TIterator begin,
TIterator end,
TCompare compare)
@@ -1315,12 +1353,13 @@ namespace etlstd
///
//***************************************************************************
template
+ ETL_NODISCARD
ETL_OR_STD::pair minmax_element(TIterator begin,
- TIterator end)
+ TIterator end)
{
- typedef typename etlstd::iterator_traits::value_type value_t;
+ typedef typename etl::iterator_traits::value_type value_t;
- return etlstd::minmax_element(begin, end, etlstd::less());
+ return etl::minmax_element(begin, end, etl::less());
}
#else
//***************************************************************************
@@ -1329,6 +1368,7 @@ namespace etlstd
///\ingroup algorithm
//***************************************************************************
template
+ ETL_NODISCARD
std::pair minmax_element(TIterator begin,
TIterator end,
TCompare compare)
@@ -1343,6 +1383,7 @@ namespace etlstd
///
//***************************************************************************
template
+ ETL_NODISCARD
std::pair minmax_element(TIterator begin,
TIterator end)
{
@@ -1357,6 +1398,7 @@ namespace etlstd
///
//***************************************************************************
template
+ ETL_NODISCARD
ETL_OR_STD::pair minmax(const T& a,
const T& b)
{
@@ -1368,11 +1410,11 @@ namespace etlstd
///\ingroup algorithm
///
//***************************************************************************
- template
- ETL_OR_STD::pair minmax(const T& a,
- const T& b,
- TCompare compare)
+ template
+ ETL_NODISCARD
+ ETL_OR_STD::pair minmax(const T& a,
+ const T& b,
+ TCompare compare)
{
return compare(b, a) ? ETL_OR_STD::pair(b, a) : ETL_OR_STD::pair(a, b);
}
@@ -1383,6 +1425,7 @@ namespace etlstd
///
//***************************************************************************
template
+ ETL_NODISCARD
std::pair minmax(const T& a,
const T& b)
{
@@ -1395,6 +1438,7 @@ namespace etlstd
///
//***************************************************************************
template
+ ETL_NODISCARD
std::pair minmax(const T& a,
const T& b,
TCompare compare)
@@ -1410,6 +1454,7 @@ namespace etlstd
///
//***************************************************************************
template
+ ETL_NODISCARD
TIterator is_sorted_until(TIterator begin,
TIterator end)
{
@@ -1436,11 +1481,11 @@ namespace etlstd
///\ingroup algorithm
///
//***************************************************************************
- template
- TIterator is_sorted_until(TIterator begin,
- TIterator end,
- TCompare compare)
+ template
+ ETL_NODISCARD
+ TIterator is_sorted_until(TIterator begin,
+ TIterator end,
+ TCompare compare)
{
if (begin != end)
{
@@ -1466,6 +1511,7 @@ namespace etlstd
///
//***************************************************************************
template
+ ETL_NODISCARD
TIterator is_sorted_until(TIterator begin,
TIterator end)
{
@@ -1478,6 +1524,7 @@ namespace etlstd
///
//***************************************************************************
template
+ ETL_NODISCARD
TIterator is_sorted_until(TIterator begin,
TIterator end,
TCompare compare)
@@ -1493,10 +1540,11 @@ namespace etlstd
///
//***************************************************************************
template
+ ETL_NODISCARD
bool is_sorted(TIterator begin,
TIterator end)
{
- return etlstd::is_sorted_until(begin, end) == end;
+ return etl::is_sorted_until(begin, end) == end;
}
//***************************************************************************
@@ -1504,13 +1552,13 @@ namespace etlstd
///\ingroup algorithm
///
//***************************************************************************
- template
- bool is_sorted(TIterator begin,
- TIterator end,
- TCompare compare)
+ template
+ ETL_NODISCARD
+ bool is_sorted(TIterator begin,
+ TIterator end,
+ TCompare compare)
{
- return etlstd::is_sorted_until(begin, end, compare) == end;
+ return etl::is_sorted_until(begin, end, compare) == end;
}
#else
//***************************************************************************
@@ -1519,6 +1567,7 @@ namespace etlstd
///
//***************************************************************************
template
+ ETL_NODISCARD
bool is_sorted(TIterator begin,
TIterator end)
{
@@ -1531,6 +1580,7 @@ namespace etlstd
///
//***************************************************************************
template
+ ETL_NODISCARD
bool is_sorted(TIterator begin,
TIterator end,
TCompare compare)
@@ -1546,6 +1596,7 @@ namespace etlstd
///
//***************************************************************************
template
+ ETL_NODISCARD
TIterator find_if_not(TIterator begin,
TIterator end,
TUnaryPredicate predicate)
@@ -1569,6 +1620,7 @@ namespace etlstd
///
//***************************************************************************
template
+ ETL_NODISCARD
TIterator find_if_not(TIterator begin,
TIterator end,
TUnaryPredicate predicate)
@@ -1584,6 +1636,7 @@ namespace etlstd
///
//***************************************************************************
template
+ ETL_NODISCARD
bool is_permutation(TIterator1 begin1,
TIterator1 end1,
TIterator2 begin2)
@@ -1592,15 +1645,15 @@ namespace etlstd
{
TIterator2 end2 = begin2;
- etlstd::advance(end2, etlstd::distance(begin1, end1));
+ etl::advance(end2, etl::distance(begin1, end1));
for (TIterator1 i = begin1; i != end1; ++i)
{
- if (i == etlstd::find(begin1, i, *i))
+ if (i == etl::find(begin1, i, *i))
{
- size_t n = etlstd::count(begin2, end2, *i);
+ size_t n = etl::count(begin2, end2, *i);
- if (n == 0 || size_t(etlstd::count(i, end1, *i)) != n)
+ if (n == 0 || size_t(etl::count(i, end1, *i)) != n)
{
return false;
}
@@ -1617,6 +1670,7 @@ namespace etlstd
///
//***************************************************************************
template
+ ETL_NODISCARD
bool is_permutation(TIterator1 begin1,
TIterator1 end1,
TIterator2 begin2,
@@ -1626,15 +1680,15 @@ namespace etlstd
{
TIterator2 end2 = begin2;
- etlstd::advance(end2, etlstd::distance(begin1, end1));
+ etl::advance(end2, etl::distance(begin1, end1));
for (TIterator1 i = begin1; i != end1; ++i)
{
- if (i == etlstd::find_if(begin1, i, etlstd::bind1st(predicate, *i)))
+ if (i == etl::find_if(begin1, i, etl::bind1st(predicate, *i)))
{
- size_t n = etlstd::count(begin2, end2, *i);
+ size_t n = etl::count(begin2, end2, *i);
- if (n == 0 || size_t(etlstd::count(i, end1, *i)) != n)
+ if (n == 0 || size_t(etl::count(i, end1, *i)) != n)
{
return false;
}
@@ -1651,6 +1705,7 @@ namespace etlstd
///
//***************************************************************************
template
+ ETL_NODISCARD
bool is_permutation(TIterator1 begin1,
TIterator1 end1,
TIterator2 begin2,
@@ -1660,11 +1715,11 @@ namespace etlstd
{
for (TIterator1 i = begin1; i != end1; ++i)
{
- if (i == etlstd::find(begin1, i, *i))
+ if (i == etl::find(begin1, i, *i))
{
- size_t n = etlstd::count(begin2, end2, *i);
+ size_t n = etl::count(begin2, end2, *i);
- if (n == 0 || size_t(etlstd::count(i, end1, *i)) != n)
+ if (n == 0 || size_t(etl::count(i, end1, *i)) != n)
{
return false;
}
@@ -1681,6 +1736,7 @@ namespace etlstd
///
//***************************************************************************
template
+ ETL_NODISCARD
bool is_permutation(TIterator1 begin1,
TIterator1 end1,
TIterator2 begin2,
@@ -1691,11 +1747,11 @@ namespace etlstd
{
for (TIterator1 i = begin1; i != end1; ++i)
{
- if (i == etlstd::find_if(begin1, i, etlstd::bind1st(predicate, *i)))
+ if (i == etl::find_if(begin1, i, etl::bind1st(predicate, *i)))
{
- size_t n = etlstd::count(begin2, end2, *i);
+ size_t n = etl::count(begin2, end2, *i);
- if (n == 0 || size_t(etlstd::count(i, end1, *i)) != n)
+ if (n == 0 || size_t(etl::count(i, end1, *i)) != n)
{
return false;
}
@@ -1712,6 +1768,7 @@ namespace etlstd
///
//***************************************************************************
template
+ ETL_NODISCARD
bool is_permutation(TIterator1 begin1,
TIterator1 end1,
TIterator2 begin2)
@@ -1725,6 +1782,7 @@ namespace etlstd
///
//***************************************************************************
template
+ ETL_NODISCARD
bool is_permutation(TIterator1 begin1,
TIterator1 end1,
TIterator2 begin2,
@@ -1739,6 +1797,7 @@ namespace etlstd
///
//***************************************************************************
template
+ ETL_NODISCARD
bool is_permutation(TIterator1 begin1,
TIterator1 end1,
TIterator2 begin2,
@@ -1753,6 +1812,7 @@ namespace etlstd
///
//***************************************************************************
template
+ ETL_NODISCARD
bool is_permutation(TIterator1 begin1,
TIterator1 end1,
TIterator2 begin2,
@@ -1770,6 +1830,7 @@ namespace etlstd
///
//***************************************************************************
template
+ ETL_NODISCARD
bool is_partitioned(TIterator begin,
TIterator end,
TUnaryPredicate predicate)
@@ -1799,6 +1860,7 @@ namespace etlstd
///
//***************************************************************************
template
+ ETL_NODISCARD
bool is_partitioned(TIterator begin,
TIterator end,
TUnaryPredicate predicate)
@@ -1814,6 +1876,7 @@ namespace etlstd
///\ingroup algorithm
//***************************************************************************
template
+ ETL_NODISCARD
TIterator partition_point(TIterator begin,
TIterator end,
TUnaryPredicate predicate)
@@ -1837,6 +1900,7 @@ namespace etlstd
///\ingroup algorithm
//***************************************************************************
template
+ ETL_NODISCARD
TIterator partition_point(TIterator begin,
TIterator end,
TUnaryPredicate predicate)
@@ -1938,11 +2002,12 @@ namespace etlstd
///
//***************************************************************************
template
+ ETL_NODISCARD
bool all_of(TIterator begin,
TIterator end,
TUnaryPredicate predicate)
{
- return etlstd::find_if_not(begin, end, predicate) == end;
+ return etl::find_if_not(begin, end, predicate) == end;
}
#else
//***************************************************************************
@@ -1951,6 +2016,7 @@ namespace etlstd
///