Merge remote-tracking branch 'origin/feature/change_stl_alternate_namespace' into development

This commit is contained in:
John Wellbelove 2019-10-10 19:30:36 +01:00
commit 480b60bd77
119 changed files with 625 additions and 616 deletions

View File

@ -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 <typename TIterator,
typename TCompare>
std::pair<TIterator, TIterator> minmax_element(TIterator begin,
ETLSTD::pair<TIterator, TIterator> minmax_element(TIterator begin,
TIterator end,
TCompare compare)
{
@ -78,7 +78,7 @@ namespace etl
++begin;
}
return std::pair<TIterator, TIterator>(minimum, maximum);
return ETLSTD::pair<TIterator, TIterator>(minimum, maximum);
}
//***************************************************************************
@ -87,12 +87,12 @@ namespace etl
///<a href="http://en.cppreference.com/w/cpp/algorithm/minmax_element"></a>
//***************************************************************************
template <typename TIterator>
std::pair<TIterator, TIterator> minmax_element(TIterator begin,
ETLSTD::pair<TIterator, TIterator> minmax_element(TIterator begin,
TIterator end)
{
typedef typename std::iterator_traits<TIterator>::value_type value_t;
typedef typename ETLSTD::iterator_traits<TIterator>::value_type value_t;
return etl::minmax_element(begin, end, std::less<value_t>());
return etl::minmax_element(begin, end, ETLSTD::less<value_t>());
}
//***************************************************************************
@ -101,10 +101,10 @@ namespace etl
///<a href="http://en.cppreference.com/w/cpp/algorithm/minmax"></a>
//***************************************************************************
template <typename T>
std::pair<const T&, const T&> minmax(const T& a,
ETLSTD::pair<const T&, const T&> minmax(const T& a,
const T& b)
{
return (b < a) ? std::pair<const T&, const T&>(b, a) : std::pair<const T&, const T&>(a, b);
return (b < a) ? ETLSTD::pair<const T&, const T&>(b, a) : ETLSTD::pair<const T&, const T&>(a, b);
}
//***************************************************************************
@ -114,11 +114,11 @@ namespace etl
//***************************************************************************
template <typename T,
typename TCompare>
std::pair<const T&, const T&> minmax(const T& a,
ETLSTD::pair<const T&, const T&> minmax(const T& a,
const T& b,
TCompare compare)
{
return compare(b, a) ? std::pair<const T&, const T&>(b, a) : std::pair<const T&, const T&>(a, b);
return compare(b, a) ? ETLSTD::pair<const T&, const T&>(b, a) : ETLSTD::pair<const T&, const T&>(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<TDestinationTrue, TDestinationFalse> partition_copy(TSource begin,
ETLSTD::pair<TDestinationTrue, TDestinationFalse> partition_copy(TSource begin,
TSource end,
TDestinationTrue destination_true,
TDestinationFalse destination_false,
@ -755,11 +755,11 @@ namespace etl
}
}
return std::pair<TDestinationTrue, TDestinationFalse>(destination_true, destination_false);
return ETLSTD::pair<TDestinationTrue, TDestinationFalse>(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 <typename TIterator,
@ -784,7 +784,7 @@ namespace etl
}
//***************************************************************************
/// Like std::for_each but for 'n' iterations.
/// Like ETLSTD::for_each but for 'n' iterations.
///\ingroup algorithm
//***************************************************************************
template <typename TIterator,
@ -803,7 +803,7 @@ namespace etl
}
//***************************************************************************
/// Like std::for_each but applies a predicate before calling the function, for 'n' iterations
/// Like ETLSTD::for_each but applies a predicate before calling the function, for 'n' iterations
///\ingroup algorithm
//***************************************************************************
template <typename TIterator,
@ -829,7 +829,7 @@ namespace etl
}
//***************************************************************************
/// A form of std::transform where the transform returns when the first range
/// A form of ETLSTD::transform where the transform returns when the first range
/// end is reached.
/// There is currently no STL equivalent.
///\ingroup algorithm
@ -865,7 +865,7 @@ namespace etl
TOutputIterator o_begin,
TUnaryFunction function)
{
std::transform(i_begin, i_begin + n, o_begin, function);
ETLSTD::transform(i_begin, i_begin + n, o_begin, function);
}
//***************************************************************************
@ -887,7 +887,7 @@ namespace etl
TOutputIterator o_begin,
TBinaryFunction function)
{
std::transform(i_begin1, i_begin1 + n, i_begin2, o_begin, function);
ETLSTD::transform(i_begin1, i_begin1 + n, i_begin2, o_begin, function);
}
//***************************************************************************
@ -940,7 +940,7 @@ namespace etl
}
//***************************************************************************
/// Like std::transform but applies a predicate before calling the function.
/// Like ETLSTD::transform but applies a predicate before calling the function.
///\ingroup algorithm
//***************************************************************************
template <typename TInputIterator,
@ -997,7 +997,7 @@ namespace etl
}
//***************************************************************************
/// Like std::transform_if, for 'n' items.
/// Like ETLSTD::transform_if, for 'n' items.
///\ingroup algorithm
//***************************************************************************
template <typename TInputIterator,
@ -1063,7 +1063,7 @@ namespace etl
template <typename TSource, typename TDestinationTrue, typename TDestinationFalse,
typename TUnaryFunctionTrue, typename TUnaryFunctionFalse,
typename TUnaryPredicate>
std::pair<TDestinationTrue, TDestinationFalse> partition_transform(TSource begin,
ETLSTD::pair<TDestinationTrue, TDestinationFalse> partition_transform(TSource begin,
TSource end,
TDestinationTrue destination_true,
TDestinationFalse destination_false,
@ -1083,7 +1083,7 @@ namespace etl
}
}
return std::pair<TDestinationTrue, TDestinationFalse>(destination_true, destination_false);
return ETLSTD::pair<TDestinationTrue, TDestinationFalse>(destination_true, destination_false);
}
//***************************************************************************
@ -1098,7 +1098,7 @@ namespace etl
typename TBinaryFunctionTrue,
typename TBinaryFunctionFalse,
typename TBinaryPredicate>
std::pair<TDestinationTrue, TDestinationFalse> partition_transform(TSource1 begin1,
ETLSTD::pair<TDestinationTrue, TDestinationFalse> partition_transform(TSource1 begin1,
TSource1 end1,
TSource2 begin2,
TDestinationTrue destination_true,
@ -1119,7 +1119,7 @@ namespace etl
}
}
return std::pair<TDestinationTrue, TDestinationFalse>(destination_true, destination_false);
return ETLSTD::pair<TDestinationTrue, TDestinationFalse>(destination_true, destination_false);
}
//***************************************************************************
@ -1130,9 +1130,9 @@ namespace etl
template <typename TIterator, typename TCompare>
void sort(TIterator first, TIterator last, TCompare compare)
{
typedef typename std::iterator_traits<TIterator>::difference_type difference_t;
typedef typename ETLSTD::iterator_traits<TIterator>::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 <typename TIterator>
void sort(TIterator first, TIterator last)
{
etl::sort(first, last, std::less<typename std::iterator_traits<TIterator>::value_type>());
etl::sort(first, last, ETLSTD::less<typename ETLSTD::iterator_traits<TIterator>::value_type>());
}
#if ETL_CPP11_SUPPORTED

View File

@ -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

View File

@ -107,8 +107,8 @@ namespace etl
typedef const T* const_pointer;
typedef T* iterator;
typedef const T* const_iterator;
typedef std::reverse_iterator<iterator> reverse_iterator;
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
typedef ETLSTD::reverse_iterator<iterator> reverse_iterator;
typedef ETLSTD::reverse_iterator<const_iterator> const_reverse_iterator;
//*************************************************************************
// Element access

View File

@ -108,8 +108,8 @@ namespace etl
typedef const T* const_pointer;
typedef T* iterator;
typedef const T* const_iterator;
typedef std::reverse_iterator<iterator> reverse_iterator;
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
typedef ETLSTD::reverse_iterator<iterator> reverse_iterator;
typedef ETLSTD::reverse_iterator<const_iterator> const_reverse_iterator;
//*************************************************************************
/// Default constructor.

View File

@ -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<iterator> reverse_iterator;
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
typedef ETLSTD::reverse_iterator<iterator> reverse_iterator;
typedef ETLSTD::reverse_iterator<const_iterator> const_reverse_iterator;
typedef typename etl::parameter_type<T>::type parameter_t;

View File

@ -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<iterator> reverse_iterator;
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
typedef ETLSTD::reverse_iterator<iterator> reverse_iterator;
typedef ETLSTD::reverse_iterator<const_iterator> const_reverse_iterator;
typedef size_t size_type;
typedef typename std::iterator_traits<iterator>::difference_type difference_type;
typedef typename ETLSTD::iterator_traits<iterator>::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<iterator>(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<T>& 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 <typename T>
bool operator ==(const etl::ibasic_string<T>& lhs, const etl::ibasic_string<T>& 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 <typename T>
bool operator ==(const etl::ibasic_string<T>& 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 <typename T>
bool operator ==(const T* lhs, const etl::ibasic_string<T>& 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 <typename T>
bool operator <(const etl::ibasic_string<T>& lhs, const etl::ibasic_string<T>& 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 <typename T>
bool operator <(const etl::ibasic_string<T>& 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 <typename T>
bool operator <(const T* lhs, const etl::ibasic_string<T>& 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());
}

View File

@ -238,7 +238,7 @@ namespace etl
ETL_STATIC_ASSERT(etl::is_integral<TValue>::value, "TValue not an integral type");
ETL_STATIC_ASSERT(etl::is_integral<TReturn>::value, "TReturn not an integral type");
ETL_STATIC_ASSERT(etl::is_signed<TReturn>::value, "TReturn not a signed type");
ETL_STATIC_ASSERT(NBITS <= std::numeric_limits<TReturn>::digits, "NBITS too large for return type");
ETL_STATIC_ASSERT(NBITS <= ETLSTD::numeric_limits<TReturn>::digits, "NBITS too large for return type");
struct S
{
@ -260,8 +260,8 @@ namespace etl
ETL_STATIC_ASSERT(etl::is_integral<TValue>::value, "TValue not an integral type");
ETL_STATIC_ASSERT(etl::is_integral<TReturn>::value, "TReturn not an integral type");
ETL_STATIC_ASSERT(etl::is_signed<TReturn>::value, "TReturn not a signed type");
ETL_STATIC_ASSERT(NBITS <= std::numeric_limits<TReturn>::digits, "NBITS too large for return type");
ETL_STATIC_ASSERT(SHIFT <= std::numeric_limits<TReturn>::digits, "SHIFT too large");
ETL_STATIC_ASSERT(NBITS <= ETLSTD::numeric_limits<TReturn>::digits, "NBITS too large for return type");
ETL_STATIC_ASSERT(SHIFT <= ETLSTD::numeric_limits<TReturn>::digits, "SHIFT too large");
struct S
{
@ -283,7 +283,7 @@ namespace etl
ETL_STATIC_ASSERT(etl::is_integral<TReturn>::value, "TReturn not an integral type");
ETL_STATIC_ASSERT(etl::is_signed<TReturn>::value, "TReturn not a signed type");
ETL_ASSERT((NBITS <= std::numeric_limits<TReturn>::digits), ETL_ERROR(binary_out_of_range));
ETL_ASSERT((NBITS <= ETLSTD::numeric_limits<TReturn>::digits), ETL_ERROR(binary_out_of_range));
TReturn mask = TReturn(1) << (NBITS - 1);
value = value & static_cast<TValue>((TReturn(1) << NBITS) - 1);
@ -304,7 +304,7 @@ namespace etl
ETL_STATIC_ASSERT(etl::is_integral<TReturn>::value, "TReturn not an integral type");
ETL_STATIC_ASSERT(etl::is_signed<TReturn>::value, "TReturn not a signed type");
ETL_ASSERT((NBITS <= std::numeric_limits<TReturn>::digits), ETL_ERROR(binary_out_of_range));
ETL_ASSERT((NBITS <= ETLSTD::numeric_limits<TReturn>::digits), ETL_ERROR(binary_out_of_range));
TReturn mask = TReturn(1) << (NBITS - 1);
value = (value >> SHIFT) & static_cast<TValue>((TReturn(1) << NBITS) - 1);

View File

@ -68,7 +68,7 @@ namespace etl
//***************************************************************************
bit_stream(char* begin_, char* end_)
: pdata(reinterpret_cast<unsigned char*>(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<unsigned char>(std::min(width, bits_in_byte));
unsigned char mask_width = static_cast<unsigned char>(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<unsigned char>(std::min(width, bits_in_byte));
unsigned char mask_width = static_cast<unsigned char>(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<unsigned char>(std::min(width, bits_in_byte));
unsigned char mask_width = static_cast<unsigned char>(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<T*>(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);
}
}

View File

@ -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<typename T> struct char_traits_types;
template<> struct char_traits_types<char>
{
typedef char char_type;
@ -62,7 +62,7 @@ namespace etl
typedef size_t pos_type;
typedef char state_type;
};
template<> struct char_traits_types<wchar_t>
{
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<char16_t>
{
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<char32_t>
{
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<typename T>
struct char_traits : public char_traits_types<T>
{
{
typedef typename char_traits_types<T>::char_type char_type;
typedef typename char_traits_types<T>::int_type int_type;
typedef typename char_traits_types<T>::off_type off_type;
typedef typename char_traits_types<T>::pos_type pos_type;
typedef typename char_traits_types<T>::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<char_type*>(src + count),
etl::copy_n(ETLSTD::reverse_iterator<char_type*>(src + count),
count,
std::reverse_iterator<char_type*>(dest + count));
ETLSTD::reverse_iterator<char_type*>(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<char_type>(c);
}
//*************************************************************************
static int_type to_int_type(char_type c)
{
return static_cast<int_type>(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)
{

View File

@ -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

View File

@ -46,9 +46,9 @@ namespace etl
{
//***************************************************************************
/// Defines <=, >, >= interms of <
/// Default
/// Default
//***************************************************************************
template <typename T, typename TLess = std::less<T> >
template <typename T, typename TLess = ETLSTD::less<T> >
struct compare
{
typedef typename etl::parameter_type<T>::type first_argument_type;

View File

@ -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<typename TValue, const size_t ARRAY_SIZE>
ETL_CONSTEXPR std::reverse_iterator<TValue*> rbegin(const TValue(&data)[ARRAY_SIZE])
ETL_CONSTEXPR ETLSTD::reverse_iterator<TValue*> rbegin(const TValue(&data)[ARRAY_SIZE])
{
return std::reverse_iterator<TValue*>(&data[ARRAY_SIZE]);
return ETLSTD::reverse_iterator<TValue*>(&data[ARRAY_SIZE]);
}
//*****************************************************************************
@ -187,9 +187,9 @@ namespace etl
///\ingroup container
//*****************************************************************************
template<typename TValue, const size_t ARRAY_SIZE>
ETL_CONSTEXPR std::reverse_iterator<const TValue*> crbegin(const TValue(&data)[ARRAY_SIZE])
ETL_CONSTEXPR ETLSTD::reverse_iterator<const TValue*> crbegin(const TValue(&data)[ARRAY_SIZE])
{
return std::reverse_iterator<const TValue*>(&data[ARRAY_SIZE]);
return ETLSTD::reverse_iterator<const TValue*>(&data[ARRAY_SIZE]);
}
//*****************************************************************************
@ -227,9 +227,9 @@ namespace etl
///\ingroup container
//*****************************************************************************
template<typename TValue, const size_t ARRAY_SIZE>
ETL_CONSTEXPR std::reverse_iterator<TValue*> rend(const TValue(&data)[ARRAY_SIZE])
ETL_CONSTEXPR ETLSTD::reverse_iterator<TValue*> rend(const TValue(&data)[ARRAY_SIZE])
{
return std::reverse_iterator<TValue*>(&data[0]);
return ETLSTD::reverse_iterator<TValue*>(&data[0]);
}
//*****************************************************************************
@ -237,9 +237,9 @@ namespace etl
///\ingroup container
//*****************************************************************************
template<typename TValue, const size_t ARRAY_SIZE>
ETL_CONSTEXPR std::reverse_iterator<const TValue*> crend(const TValue(&data)[ARRAY_SIZE])
ETL_CONSTEXPR ETLSTD::reverse_iterator<const TValue*> crend(const TValue(&data)[ARRAY_SIZE])
{
return std::reverse_iterator<const TValue*>(&data[0]);
return ETLSTD::reverse_iterator<const TValue*>(&data[0]);
}
//*****************************************************************************
@ -249,7 +249,7 @@ namespace etl
template<class TIterator>
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<class TIterator>
TIterator prev(TIterator iterator, ptrdiff_t n = 1)
{
std::advance(iterator, -n);
ETLSTD::advance(iterator, -n);
return iterator;
}

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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_);
}

View File

@ -44,8 +44,8 @@ namespace etl
template <typename T,
const size_t SAMPLE_SIZE,
const size_t SCALING = 1U,
const bool IsIntegral = std::is_integral<T>::value,
const bool IsFloat = std::is_floating_point<T>::value>
const bool IsIntegral = etl::is_integral<T>::value,
const bool IsFloat = etl::is_floating_point<T>::value>
class cumulative_moving_average;
//***************************************************************************

View File

@ -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<T, FIRST, LAST>& other)
{
std::swap(value, other.value);
ETLSTD::swap(value, other.value);
}
//*************************************************************************
@ -531,9 +531,9 @@ namespace etl
//*************************************************************************
void swap(cyclic_value<T, FIRST, LAST>& 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);
}
//*************************************************************************

View File

@ -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

View File

@ -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

View File

@ -238,7 +238,7 @@ namespace etl
#endif
typedef T* pointer;
typedef const T* const_pointer;
typedef typename std::iterator_traits<pointer>::difference_type difference_type;
typedef typename ETLSTD::iterator_traits<pointer>::difference_type difference_type;
protected:
@ -633,8 +633,8 @@ namespace etl
pointer p_buffer;
};
typedef std::reverse_iterator<iterator> reverse_iterator;
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
typedef ETLSTD::reverse_iterator<iterator> reverse_iterator;
typedef ETLSTD::reverse_iterator<const_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<pointer>::difference_type difference_type;
typedef typename ETLSTD::iterator_traits<pointer>::difference_type difference_type;
//*************************************************************************
/// Default constructor.

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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<N> : Calculates the Nth factorial value.
///\ingroup maths
namespace etl
namespace etl
{
//***************************************************************************
///\ingroup fibonacci

View File

@ -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<N> : Calculates the Nth Fibonacci value.
///\ingroup maths
namespace etl
namespace etl
{
//***************************************************************************
///\ingroup fibonacci

View File

@ -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 <typename TIterator>
class fixed_iterator : std::iterator<typename std::iterator_traits<TIterator>::iterator_category, typename std::iterator_traits<TIterator>::value_type>
class fixed_iterator : ETLSTD::iterator<typename ETLSTD::iterator_traits<TIterator>::iterator_category, typename ETLSTD::iterator_traits<TIterator>::value_type>
{
public:
@ -99,7 +99,7 @@ namespace etl
//***************************************************************************
/// Dereference operator.
//***************************************************************************
typename std::iterator_traits<TIterator>::value_type operator *()
typename ETLSTD::iterator_traits<TIterator>::value_type operator *()
{
return *it;
}
@ -107,7 +107,7 @@ namespace etl
//***************************************************************************
/// Dereference operator.
//***************************************************************************
const typename std::iterator_traits<TIterator>::value_type operator *() const
const typename ETLSTD::iterator_traits<TIterator>::value_type operator *() const
{
return *it;
}
@ -139,7 +139,7 @@ namespace etl
//***************************************************************************
/// += operator.
//***************************************************************************
fixed_iterator& operator +=(typename std::iterator_traits<TIterator>::difference_type /*offset*/)
fixed_iterator& operator +=(typename ETLSTD::iterator_traits<TIterator>::difference_type /*offset*/)
{
return *this;
}
@ -147,7 +147,7 @@ namespace etl
//***************************************************************************
/// -= operator.
//***************************************************************************
fixed_iterator& operator -=(typename std::iterator_traits<TIterator>::difference_type /*offset*/)
fixed_iterator& operator -=(typename ETLSTD::iterator_traits<TIterator>::difference_type /*offset*/)
{
return *this;
}
@ -180,7 +180,7 @@ namespace etl
//*****************************************************************************
template <typename TIterator>
etl::fixed_iterator<TIterator>& operator +(etl::fixed_iterator<TIterator>& lhs,
typename std::iterator_traits<TIterator>::difference_type /*rhs*/)
typename ETLSTD::iterator_traits<TIterator>::difference_type /*rhs*/)
{
return lhs;
}
@ -190,7 +190,7 @@ namespace etl
//*****************************************************************************
template <typename TIterator>
etl::fixed_iterator<TIterator>& operator -(etl::fixed_iterator<TIterator>& lhs,
typename std::iterator_traits<TIterator>::difference_type /*rhs*/)
typename ETLSTD::iterator_traits<TIterator>::difference_type /*rhs*/)
{
return lhs;
}
@ -199,7 +199,7 @@ namespace etl
/// - fixed_iterator operator.
//*****************************************************************************
template <typename TIterator>
typename std::iterator_traits<TIterator>::difference_type operator -(etl::fixed_iterator<TIterator>& lhs,
typename ETLSTD::iterator_traits<TIterator>::difference_type operator -(etl::fixed_iterator<TIterator>& lhs,
etl::fixed_iterator<TIterator>& rhs)
{
return TIterator(lhs) - TIterator(rhs);

View File

@ -85,9 +85,9 @@ namespace etl
typedef typename refmap_t::iterator iterator;
typedef typename refmap_t::const_iterator const_iterator;
typedef std::reverse_iterator<iterator> reverse_iterator;
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
typedef typename std::iterator_traits<iterator>::difference_type difference_type;
typedef ETLSTD::reverse_iterator<iterator> reverse_iterator;
typedef ETLSTD::reverse_iterator<const_iterator> const_reverse_iterator;
typedef typename ETLSTD::iterator_traits<iterator>::difference_type difference_type;
protected:

View File

@ -86,9 +86,9 @@ namespace etl
typedef typename refmap_t::iterator iterator;
typedef typename refmap_t::const_iterator const_iterator;
typedef std::reverse_iterator<iterator> reverse_iterator;
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
typedef typename std::iterator_traits<iterator>::difference_type difference_type;
typedef ETLSTD::reverse_iterator<iterator> reverse_iterator;
typedef ETLSTD::reverse_iterator<const_iterator> const_reverse_iterator;
typedef typename ETLSTD::iterator_traits<iterator>::difference_type difference_type;
protected:

View File

@ -80,9 +80,9 @@ namespace etl
typedef typename refset_t::iterator iterator;
typedef typename refset_t::const_iterator const_iterator;
typedef std::reverse_iterator<iterator> reverse_iterator;
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
typedef typename std::iterator_traits<iterator>::difference_type difference_type;
typedef ETLSTD::reverse_iterator<iterator> reverse_iterator;
typedef ETLSTD::reverse_iterator<const_iterator> const_reverse_iterator;
typedef typename ETLSTD::iterator_traits<iterator>::difference_type difference_type;
protected:

View File

@ -82,9 +82,9 @@ namespace etl
typedef typename refset_t::iterator iterator;
typedef typename refset_t::const_iterator const_iterator;
typedef std::reverse_iterator<iterator> reverse_iterator;
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
typedef typename std::iterator_traits<iterator>::difference_type difference_type;
typedef ETLSTD::reverse_iterator<iterator> reverse_iterator;
typedef ETLSTD::reverse_iterator<const_iterator> const_reverse_iterator;
typedef typename ETLSTD::iterator_traits<iterator>::difference_type difference_type;
protected:

View File

@ -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;

View File

@ -571,7 +571,7 @@ namespace etl
const node_t* p_node;
};
typedef typename std::iterator_traits<iterator>::difference_type difference_type;
typedef typename ETLSTD::iterator_traits<iterator>::difference_type difference_type;
//*************************************************************************
/// Gets the beginning of the forward_list.

View File

@ -74,7 +74,7 @@ namespace etl
template<typename TIterator>
frame_check_sequence(TIterator begin, const TIterator end)
{
ETL_STATIC_ASSERT(sizeof(typename std::iterator_traits<TIterator>::value_type) == 1, "Type not supported");
ETL_STATIC_ASSERT(sizeof(typename ETLSTD::iterator_traits<TIterator>::value_type) == 1, "Type not supported");
reset();
add(begin, end);
@ -96,7 +96,7 @@ namespace etl
template<typename TIterator>
void add(TIterator begin, const TIterator end)
{
ETL_STATIC_ASSERT(sizeof(typename std::iterator_traits<TIterator>::value_type) == 1, "Type not supported");
ETL_STATIC_ASSERT(sizeof(typename ETLSTD::iterator_traits<TIterator>::value_type) == 1, "Type not supported");
while (begin != end)
{

View File

@ -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

View File

@ -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;

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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
//*****************************************************************************

View File

@ -494,7 +494,7 @@ namespace etl
const value_type* p_value;
};
typedef typename std::iterator_traits<iterator>::difference_type difference_type;
typedef typename ETLSTD::iterator_traits<iterator>::difference_type difference_type;
//*************************************************************************
/// Constructor.

View File

@ -579,7 +579,7 @@ namespace etl
const value_type* p_value;
};
typedef typename std::iterator_traits<iterator>::difference_type difference_type;
typedef typename ETLSTD::iterator_traits<iterator>::difference_type difference_type;
//*************************************************************************
/// Constructor.

View File

@ -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 <typename T, uintptr_t ADDRESS = 0>
class io_port_rw : public std::iterator<std::forward_iterator_tag, T>
class io_port_rw : public ETLSTD::iterator<ETLSTD::forward_iterator_tag, T>
{
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 <typename T, uintptr_t ADDRESS = 0>
class io_port_ro : public std::iterator<std::input_iterator_tag, T>
class io_port_ro : public ETLSTD::iterator<ETLSTD::input_iterator_tag, T>
{
public:
@ -192,7 +192,7 @@ namespace etl
/// Write only port.
//***************************************************************************
template <typename T, uintptr_t ADDRESS = 0>
class io_port_wo : public std::iterator<std::output_iterator_tag, T>
class io_port_wo : public ETLSTD::iterator<ETLSTD::output_iterator_tag, T>
{
public:
@ -256,7 +256,7 @@ namespace etl
/// Write only port with shadow register.
//***************************************************************************
template <typename T, uintptr_t ADDRESS = 0>
class io_port_wos : public std::iterator<std::forward_iterator_tag, T>
class io_port_wos : public ETLSTD::iterator<ETLSTD::forward_iterator_tag, T>
{
public:
@ -335,7 +335,7 @@ namespace etl
/// Specialisation for dynamic addresses.
//***************************************************************************
template <typename T>
class io_port_rw<T, 0> : public std::iterator<std::forward_iterator_tag, T>
class io_port_rw<T, 0> : public ETLSTD::iterator<ETLSTD::forward_iterator_tag, T>
{
public:
@ -446,7 +446,7 @@ namespace etl
/// Specialisation for dynamic addresses.
//***************************************************************************
template <typename T>
class io_port_ro<T, 0> : public std::iterator<std::input_iterator_tag, T>
class io_port_ro<T, 0> : public ETLSTD::iterator<ETLSTD::input_iterator_tag, T>
{
public:
@ -535,7 +535,7 @@ namespace etl
/// Specialisation for dynamic addresses.
//***************************************************************************
template <typename T>
class io_port_wo<T, 0> : public std::iterator<std::output_iterator_tag, T>
class io_port_wo<T, 0> : public ETLSTD::iterator<ETLSTD::output_iterator_tag, T>
{
public:
@ -616,7 +616,7 @@ namespace etl
{
return *this;
}
private:
/// Read disabled.
@ -630,7 +630,7 @@ namespace etl
/// Specialisation for dynamic addresses.
//***************************************************************************
template <typename T>
class io_port_wos<T, 0> : public std::iterator<std::forward_iterator_tag, T>
class io_port_wos<T, 0> : public ETLSTD::iterator<ETLSTD::forward_iterator_tag, T>
{
public:
@ -639,7 +639,7 @@ namespace etl
typedef volatile T& reference;
typedef volatile const T& const_reference;
class iterator : public std::iterator<std::bidirectional_iterator_tag, T>
class iterator : public ETLSTD::iterator<ETLSTD::bidirectional_iterator_tag, T>
{
typedef io_port_wos<T, 0> 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;

View File

@ -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 <typename T>
struct is_input_iterator
{
static const bool value = etl::is_same<typename std::iterator_traits<T>::iterator_category, std::input_iterator_tag>::value;
static const bool value = etl::is_same<typename ETLSTD::iterator_traits<T>::iterator_category, ETLSTD::input_iterator_tag>::value;
};
template <typename T>
struct is_output_iterator
{
static const bool value = etl::is_same<typename std::iterator_traits<T>::iterator_category, std::output_iterator_tag>::value;
static const bool value = etl::is_same<typename ETLSTD::iterator_traits<T>::iterator_category, ETLSTD::output_iterator_tag>::value;
};
template <typename T>
struct is_forward_iterator
{
static const bool value = etl::is_same<typename std::iterator_traits<T>::iterator_category, std::forward_iterator_tag>::value;
static const bool value = etl::is_same<typename ETLSTD::iterator_traits<T>::iterator_category, ETLSTD::forward_iterator_tag>::value;
};
template <typename T>
struct is_bidirectional_iterator
{
static const bool value = etl::is_same<typename std::iterator_traits<T>::iterator_category, std::bidirectional_iterator_tag>::value;
static const bool value = etl::is_same<typename ETLSTD::iterator_traits<T>::iterator_category, ETLSTD::bidirectional_iterator_tag>::value;
};
template <typename T>
struct is_random_iterator
{
static const bool value = etl::is_same<typename std::iterator_traits<T>::iterator_category, std::random_access_iterator_tag>::value;
static const bool value = etl::is_same<typename ETLSTD::iterator_traits<T>::iterator_category, ETLSTD::random_access_iterator_tag>::value;
};
template <typename T>
struct is_input_iterator_concept
{
static const bool value = etl::is_input_iterator<T>::value ||
static const bool value = etl::is_input_iterator<T>::value ||
etl::is_forward_iterator<T>::value ||
etl::is_bidirectional_iterator<T>::value ||
etl::is_random_iterator<T>::value;

View File

@ -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

View File

@ -675,10 +675,10 @@ namespace etl
const node_t* p_node;
};
typedef typename std::iterator_traits<iterator>::difference_type difference_type;
typedef typename ETLSTD::iterator_traits<iterator>::difference_type difference_type;
typedef std::reverse_iterator<iterator> reverse_iterator;
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
typedef ETLSTD::reverse_iterator<iterator> reverse_iterator;
typedef ETLSTD::reverse_iterator<const_iterator> const_reverse_iterator;
//*************************************************************************
/// Gets the beginning of the list.

View File

@ -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<N> : Calculates logs to base 10, rounded down to the nearest integer.<br>
///\ingroup maths
namespace etl
namespace etl
{
//***************************************************************************
///\ingroup log

View File

@ -803,10 +803,10 @@ namespace etl
friend class const_iterator;
typedef typename std::iterator_traits<iterator>::difference_type difference_type;
typedef typename ETLSTD::iterator_traits<iterator>::difference_type difference_type;
typedef std::reverse_iterator<iterator> reverse_iterator;
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
typedef ETLSTD::reverse_iterator<iterator> reverse_iterator;
typedef ETLSTD::reverse_iterator<const_iterator> const_reverse_iterator;
//*************************************************************************
/// Gets the beginning of the map.

View File

@ -60,10 +60,10 @@ namespace etl
///\ingroup memory
//*****************************************************************************
template <typename TOutputIterator, typename T>
typename etl::enable_if<etl::is_trivially_constructible<typename std::iterator_traits<TOutputIterator>::value_type>::value, TOutputIterator>::type
typename etl::enable_if<etl::is_trivially_constructible<typename ETLSTD::iterator_traits<TOutputIterator>::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 TOutputIterator, typename T>
typename etl::enable_if<!etl::is_trivially_constructible<typename std::iterator_traits<TOutputIterator>::value_type>::value, TOutputIterator>::type
typename etl::enable_if<!etl::is_trivially_constructible<typename ETLSTD::iterator_traits<TOutputIterator>::value_type>::value, TOutputIterator>::type
uninitialized_fill(TOutputIterator o_begin, TOutputIterator o_end, const T& value)
{
typedef typename std::iterator_traits<TOutputIterator>::value_type value_type;
typedef typename ETLSTD::iterator_traits<TOutputIterator>::value_type value_type;
while (o_begin != o_end)
{
@ -93,12 +93,12 @@ namespace etl
///\ingroup memory
//*****************************************************************************
template <typename TOutputIterator, typename T, typename TCounter>
typename etl::enable_if<etl::is_trivially_constructible<typename std::iterator_traits<TOutputIterator>::value_type>::value, TOutputIterator>::type
typename etl::enable_if<etl::is_trivially_constructible<typename ETLSTD::iterator_traits<TOutputIterator>::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 TOutputIterator, typename T, typename TCounter>
typename etl::enable_if<!etl::is_trivially_constructible<typename std::iterator_traits<TOutputIterator>::value_type>::value, TOutputIterator>::type
typename etl::enable_if<!etl::is_trivially_constructible<typename ETLSTD::iterator_traits<TOutputIterator>::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 TInputIterator, typename TOutputIterator>
typename etl::enable_if<etl::is_trivially_constructible<typename std::iterator_traits<TOutputIterator>::value_type>::value, TOutputIterator>::type
typename etl::enable_if<etl::is_trivially_constructible<typename ETLSTD::iterator_traits<TOutputIterator>::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 TInputIterator, typename TOutputIterator>
typename etl::enable_if<!etl::is_trivially_constructible<typename std::iterator_traits<TOutputIterator>::value_type>::value, TOutputIterator>::type
typename etl::enable_if<!etl::is_trivially_constructible<typename ETLSTD::iterator_traits<TOutputIterator>::value_type>::value, TOutputIterator>::type
uninitialized_copy(TInputIterator i_begin, TInputIterator i_end, TOutputIterator o_begin)
{
typedef typename std::iterator_traits<TOutputIterator>::value_type value_type;
typedef typename ETLSTD::iterator_traits<TOutputIterator>::value_type value_type;
TOutputIterator o_end = o_begin;
@ -181,11 +181,11 @@ namespace etl
///\ingroup memory
//*****************************************************************************
template <typename TInputIterator, typename TOutputIterator, typename TCounter>
typename etl::enable_if<etl::is_trivially_constructible<typename std::iterator_traits<TOutputIterator>::value_type>::value, TOutputIterator>::type
typename etl::enable_if<etl::is_trivially_constructible<typename ETLSTD::iterator_traits<TOutputIterator>::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 TInputIterator, typename TOutputIterator, typename TCounter>
typename etl::enable_if<!etl::is_trivially_constructible<typename std::iterator_traits<TOutputIterator>::value_type>::value, TOutputIterator>::type
typename etl::enable_if<!etl::is_trivially_constructible<typename ETLSTD::iterator_traits<TOutputIterator>::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 TOutputIterator>
typename etl::enable_if<etl::is_trivially_constructible<typename std::iterator_traits<TOutputIterator>::value_type>::value, void>::type
typename etl::enable_if<etl::is_trivially_constructible<typename ETLSTD::iterator_traits<TOutputIterator>::value_type>::value, void>::type
uninitialized_default_construct(TOutputIterator /*o_begin*/, TOutputIterator /*o_end*/)
{
}
@ -288,10 +288,10 @@ namespace etl
///\ingroup memory
//*****************************************************************************
template <typename TOutputIterator>
typename etl::enable_if<!etl::is_trivially_constructible<typename std::iterator_traits<TOutputIterator>::value_type>::value, void>::type
typename etl::enable_if<!etl::is_trivially_constructible<typename ETLSTD::iterator_traits<TOutputIterator>::value_type>::value, void>::type
uninitialized_default_construct(TOutputIterator o_begin, TOutputIterator o_end)
{
typedef typename std::iterator_traits<TOutputIterator>::value_type value_type;
typedef typename ETLSTD::iterator_traits<TOutputIterator>::value_type value_type;
while (o_begin != o_end)
{
@ -306,10 +306,10 @@ namespace etl
///\ingroup memory
//*****************************************************************************
template <typename TOutputIterator, typename TCounter>
typename etl::enable_if<etl::is_trivially_constructible<typename std::iterator_traits<TOutputIterator>::value_type>::value, void>::type
typename etl::enable_if<etl::is_trivially_constructible<typename ETLSTD::iterator_traits<TOutputIterator>::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 TOutputIterator, typename TCounter>
typename etl::enable_if<!etl::is_trivially_constructible<typename std::iterator_traits<TOutputIterator>::value_type>::value, void>::type
typename etl::enable_if<!etl::is_trivially_constructible<typename ETLSTD::iterator_traits<TOutputIterator>::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 TOutputIterator, typename TSize>
typename etl::enable_if<etl::is_trivially_constructible<typename std::iterator_traits<TOutputIterator>::value_type>::value, TOutputIterator>::type
typename etl::enable_if<etl::is_trivially_constructible<typename ETLSTD::iterator_traits<TOutputIterator>::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 TOutputIterator, typename TSize>
typename etl::enable_if<!etl::is_trivially_constructible<typename std::iterator_traits<TOutputIterator>::value_type>::value, TOutputIterator>::type
typename etl::enable_if<!etl::is_trivially_constructible<typename ETLSTD::iterator_traits<TOutputIterator>::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 TOutputIterator, typename TSize, typename TCounter>
typename etl::enable_if<etl::is_trivially_constructible<typename std::iterator_traits<TOutputIterator>::value_type>::value, TOutputIterator>::type
typename etl::enable_if<etl::is_trivially_constructible<typename ETLSTD::iterator_traits<TOutputIterator>::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 TOutputIterator, typename TSize, typename TCounter>
typename etl::enable_if<!etl::is_trivially_constructible<typename std::iterator_traits<TOutputIterator>::value_type>::value, TOutputIterator>::type
typename etl::enable_if<!etl::is_trivially_constructible<typename ETLSTD::iterator_traits<TOutputIterator>::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 <typename T>
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 <typename T>
T& make_copy_at(T* p, T&& other)
{
::new (p) T(std::move(other));
::new (p) T(ETLSTD::move(other));
return *reinterpret_cast<T*>(p);
}
#endif
@ -520,7 +520,7 @@ namespace etl
template <typename T, typename TParameter>
T& make_value_at(T* p, TParameter&& value)
{
::new (p) T(std::move(value));
::new (p) T(ETLSTD::move(value));
return *reinterpret_cast<T*>(p);
}
#endif
@ -542,12 +542,12 @@ namespace etl
///\ingroup memory
//*****************************************************************************
template <typename TOutputIterator>
typename etl::enable_if<etl::is_trivially_constructible<typename std::iterator_traits<TOutputIterator>::value_type>::value, void>::type
typename etl::enable_if<etl::is_trivially_constructible<typename ETLSTD::iterator_traits<TOutputIterator>::value_type>::value, void>::type
uninitialized_value_construct(TOutputIterator o_begin, TOutputIterator o_end)
{
typedef typename std::iterator_traits<TOutputIterator>::value_type value_type;
typedef typename ETLSTD::iterator_traits<TOutputIterator>::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 TOutputIterator>
typename etl::enable_if<!etl::is_trivially_constructible<typename std::iterator_traits<TOutputIterator>::value_type>::value, void>::type
typename etl::enable_if<!etl::is_trivially_constructible<typename ETLSTD::iterator_traits<TOutputIterator>::value_type>::value, void>::type
uninitialized_value_construct(TOutputIterator o_begin, TOutputIterator o_end)
{
typedef typename std::iterator_traits<TOutputIterator>::value_type value_type;
typedef typename ETLSTD::iterator_traits<TOutputIterator>::value_type value_type;
while (o_begin != o_end)
{
@ -575,7 +575,7 @@ namespace etl
template <typename TOutputIterator, typename TCounter>
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 TIterator>
typename etl::enable_if<etl::is_trivially_destructible<typename std::iterator_traits<TIterator>::value_type>::value, void>::type
typename etl::enable_if<etl::is_trivially_destructible<typename ETLSTD::iterator_traits<TIterator>::value_type>::value, void>::type
destroy(TIterator /*i_begin*/, TIterator /*i_end*/)
{
}
@ -672,7 +672,7 @@ namespace etl
///\ingroup memory
//*****************************************************************************
template <typename TIterator>
typename etl::enable_if<!etl::is_trivially_destructible<typename std::iterator_traits<TIterator>::value_type>::value, void>::type
typename etl::enable_if<!etl::is_trivially_destructible<typename ETLSTD::iterator_traits<TIterator>::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 TIterator, typename TCounter>
typename etl::enable_if<etl::is_trivially_destructible<typename std::iterator_traits<TIterator>::value_type>::value, void>::type
typename etl::enable_if<etl::is_trivially_destructible<typename ETLSTD::iterator_traits<TIterator>::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 TIterator, typename TCounter>
typename etl::enable_if<!etl::is_trivially_destructible<typename std::iterator_traits<TIterator>::value_type>::value, void>::type
typename etl::enable_if<!etl::is_trivially_destructible<typename ETLSTD::iterator_traits<TIterator>::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 TIterator, typename TSize>
typename etl::enable_if<etl::is_trivially_destructible<typename std::iterator_traits<TIterator>::value_type>::value, TIterator>::type
typename etl::enable_if<etl::is_trivially_destructible<typename ETLSTD::iterator_traits<TIterator>::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 TIterator, typename TSize>
typename etl::enable_if<!etl::is_trivially_destructible<typename std::iterator_traits<TIterator>::value_type>::value, TIterator>::type
typename etl::enable_if<!etl::is_trivially_destructible<typename ETLSTD::iterator_traits<TIterator>::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 TIterator, typename TSize, typename TCounter>
typename etl::enable_if<etl::is_trivially_destructible<typename std::iterator_traits<TIterator>::value_type>::value, TIterator>::type
typename etl::enable_if<etl::is_trivially_destructible<typename ETLSTD::iterator_traits<TIterator>::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 TIterator, typename TSize, typename TCounter>
typename etl::enable_if<!etl::is_trivially_destructible<typename std::iterator_traits<TIterator>::value_type>::value, TIterator>::type
typename etl::enable_if<!etl::is_trivially_destructible<typename ETLSTD::iterator_traits<TIterator>::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 <typename T>
void memory_clear_range(volatile T* begin, volatile T* end)
{
const size_t n = static_cast<size_t>(std::distance(begin, end));
const size_t n = static_cast<size_t>(ETLSTD::distance(begin, end));
memory_clear_range(begin, n);
}
@ -1215,7 +1215,7 @@ namespace etl
template <typename T>
void memory_set_range(volatile T* begin, volatile T* end, const char value)
{
const size_t n = static_cast<size_t>(std::distance(begin, end));
const size_t n = static_cast<size_t>(ETLSTD::distance(begin, end));
memory_set_range(begin, n, value);
}

View File

@ -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)
{
}

View File

@ -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<router_list_t::iterator, router_list_t::iterator> range = std::equal_range(router_list.begin(),
ETLSTD::pair<router_list_t::iterator, router_list_t::iterator> 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<router_list_t::iterator, router_list_t::iterator> range = std::equal_range(router_list.begin(),
ETLSTD::pair<router_list_t::iterator, router_list_t::iterator> 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());

View File

@ -954,10 +954,10 @@ namespace etl
};
friend class const_iterator;
typedef typename std::iterator_traits<iterator>::difference_type difference_type;
typedef typename ETLSTD::iterator_traits<iterator>::difference_type difference_type;
typedef std::reverse_iterator<iterator> reverse_iterator;
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
typedef ETLSTD::reverse_iterator<iterator> reverse_iterator;
typedef ETLSTD::reverse_iterator<const_iterator> const_reverse_iterator;
//*************************************************************************
/// Gets the beginning of the multimap.

View File

@ -920,10 +920,10 @@ namespace etl
};
friend class const_iterator;
typedef typename std::iterator_traits<iterator>::difference_type difference_type;
typedef typename ETLSTD::iterator_traits<iterator>::difference_type difference_type;
typedef std::reverse_iterator<iterator> reverse_iterator;
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
typedef ETLSTD::reverse_iterator<iterator> reverse_iterator;
typedef ETLSTD::reverse_iterator<const_iterator> const_reverse_iterator;
//*************************************************************************
/// Gets the beginning of the multiset.

View File

@ -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<TIterator>::value_type) == 1, "Incompatible type");
ETL_STATIC_ASSERT(sizeof(typename ETLSTD::iterator_traits<TIterator>::value_type) == 1, "Incompatible type");
reset();
while (begin != end)
@ -119,7 +119,7 @@ namespace etl
template<typename TIterator>
void add(TIterator begin, const TIterator end)
{
ETL_STATIC_ASSERT(sizeof(typename std::iterator_traits<TIterator>::value_type) == 1, "Incompatible type");
ETL_STATIC_ASSERT(sizeof(typename ETLSTD::iterator_traits<TIterator>::value_type) == 1, "Incompatible type");
ETL_ASSERT(!is_finalised, ETL_ERROR(hash_finalised));
while (begin != end)

View File

@ -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
{

View File

@ -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

View File

@ -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 <b>value</b>.
///\param first An iterator to the first position to fill.
///\param last An iterator to the last + 1 position.

View File

@ -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);

View File

@ -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

View File

@ -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<TIterator>::value_type) == 1, "Type not supported");
ETL_STATIC_ASSERT(sizeof(typename ETLSTD::iterator_traits<TIterator>::value_type) == 1, "Type not supported");
reset();
add(begin, end);
@ -103,7 +103,7 @@ namespace etl
template<typename TIterator>
void add(TIterator begin, const TIterator end)
{
ETL_STATIC_ASSERT(sizeof(typename std::iterator_traits<TIterator>::value_type) == 1, "Type not supported");
ETL_STATIC_ASSERT(sizeof(typename ETLSTD::iterator_traits<TIterator>::value_type) == 1, "Type not supported");
while (begin != end)
{

View File

@ -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

View File

@ -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<N, POWER> : Calculates N to the power POWER.
///\ingroup maths
namespace etl
namespace etl
{
//***************************************************************************
///\ingroup power

View File

@ -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<typename TContainer::iterator>::difference_type difference_type;
typedef typename ETLSTD::iterator_traits<typename TContainer::iterator>::difference_type difference_type;
private:

View File

@ -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<iterator> reverse_iterator;
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
typedef ETLSTD::reverse_iterator<iterator> reverse_iterator;
typedef ETLSTD::reverse_iterator<const_iterator> const_reverse_iterator;
typedef size_t size_type;
typedef typename std::iterator_traits<iterator>::difference_type difference_type;
typedef typename ETLSTD::iterator_traits<iterator>::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<iterator> reverse_iterator;
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
typedef ETLSTD::reverse_iterator<iterator> reverse_iterator;
typedef ETLSTD::reverse_iterator<const_iterator> const_reverse_iterator;
typedef size_t size_type;
typedef typename std::iterator_traits<iterator>::difference_type difference_type;
typedef typename ETLSTD::iterator_traits<iterator>::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)))
}
};

View File

@ -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<iterator> reverse_iterator;
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
typedef ETLSTD::reverse_iterator<iterator> reverse_iterator;
typedef ETLSTD::reverse_iterator<const_iterator> const_reverse_iterator;
typedef size_t size_type;
typedef std::iterator_traits<iterator>::difference_type difference_type;
typedef ETLSTD::iterator_traits<iterator>::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<size_t>(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 <typename TIterator>
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());
}
//***************************************************************************

View File

@ -56,7 +56,7 @@ namespace etl
template <typename TIString>
void add_alignment(TIString& str, typename TIString::iterator position, const etl::basic_format_spec<TIString>& format)
{
uint32_t length = static_cast<uint32_t>(std::distance(position, str.end()));
uint32_t length = static_cast<uint32_t>(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<T>::digits10;
uint32_t max_precision = ETLSTD::numeric_limits<T>::digits10;
etl::basic_format_spec<TIString> integral_format = format;
integral_format.decimal().width(0).precision(format.get_precision() > max_precision ? max_precision : format.get_precision());

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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 <const size_t NUM, const size_t DEN = 1>
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

View File

@ -316,9 +316,9 @@ namespace etl
typename lookup_t::const_iterator ilookup;
};
typedef std::reverse_iterator<iterator> reverse_iterator;
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
typedef typename std::iterator_traits<iterator>::difference_type difference_type;
typedef ETLSTD::reverse_iterator<iterator> reverse_iterator;
typedef ETLSTD::reverse_iterator<const_iterator> const_reverse_iterator;
typedef typename ETLSTD::iterator_traits<iterator>::difference_type difference_type;
protected:
@ -524,7 +524,7 @@ namespace etl
template <typename TIterator>
void assign(TIterator first, TIterator last)
{
ETL_STATIC_ASSERT((etl::is_same<value_type, typename std::iterator_traits<TIterator>::value_type>::value), "Incompatible data for assign");
ETL_STATIC_ASSERT((etl::is_same<value_type, typename ETLSTD::iterator_traits<TIterator>::value_type>::value), "Incompatible data for assign");
#if defined(ETL_DEBUG)
difference_type d = std::distance(first, last);

View File

@ -291,9 +291,9 @@ namespace etl
typename lookup_t::const_iterator ilookup;
};
typedef std::reverse_iterator<iterator> reverse_iterator;
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
typedef typename std::iterator_traits<iterator>::difference_type difference_type;
typedef ETLSTD::reverse_iterator<iterator> reverse_iterator;
typedef ETLSTD::reverse_iterator<const_iterator> const_reverse_iterator;
typedef typename ETLSTD::iterator_traits<iterator>::difference_type difference_type;
protected:

View File

@ -316,9 +316,9 @@ namespace etl
public:
typedef std::reverse_iterator<iterator> reverse_iterator;
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
typedef typename std::iterator_traits<iterator>::difference_type difference_type;
typedef ETLSTD::reverse_iterator<iterator> reverse_iterator;
typedef ETLSTD::reverse_iterator<const_iterator> const_reverse_iterator;
typedef typename ETLSTD::iterator_traits<iterator>::difference_type difference_type;
//*********************************************************************
/// Returns an iterator to the beginning of the reference_flat_multiset.

View File

@ -316,9 +316,9 @@ namespace etl
public:
typedef std::reverse_iterator<iterator> reverse_iterator;
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
typedef typename std::iterator_traits<iterator>::difference_type difference_type;
typedef ETLSTD::reverse_iterator<iterator> reverse_iterator;
typedef ETLSTD::reverse_iterator<const_iterator> const_reverse_iterator;
typedef typename ETLSTD::iterator_traits<iterator>::difference_type difference_type;
//*********************************************************************
/// Returns an iterator to the beginning of the reference_flat_set.

View File

@ -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());

View File

@ -760,10 +760,10 @@ namespace etl
};
friend class const_iterator;
typedef typename std::iterator_traits<iterator>::difference_type difference_type;
typedef typename ETLSTD::iterator_traits<iterator>::difference_type difference_type;
typedef std::reverse_iterator<iterator> reverse_iterator;
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
typedef ETLSTD::reverse_iterator<iterator> reverse_iterator;
typedef ETLSTD::reverse_iterator<const_iterator> const_reverse_iterator;
//*************************************************************************
/// Assignment operator.

View File

@ -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));

View File

@ -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

View File

@ -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"

View File

@ -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 TIterator, typename TDistance>
typename etl::enable_if<!etl::is_same<typename ETLSTD::iterator_traits<TIterator>::iterator_tag, ETLSTD::random_access_iterator_tag>::value, void>::type
typename etl::enable_if<!etl::is_same<typename etlstd::iterator_traits<TIterator>::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 TIterator, typename TDistance>
typename etl::enable_if<etl::is_same<typename ETLSTD::iterator_traits<TIterator>::iterator_tag, ETLSTD::random_access_iterator_tag>::value, void>::type
typename etl::enable_if<etl::is_same<typename etlstd::iterator_traits<TIterator>::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 TIterator1, typename TIterator2>
typename etl::enable_if<etl::is_pointer<TIterator1>::value &&
etl::is_pointer<TIterator2>::value &&
etl::is_pod<typename ETLSTD::iterator_traits<TIterator1>::value_type>::value, TIterator2>::type
etl::is_pod<typename etlstd::iterator_traits<TIterator1>::value_type>::value, TIterator2>::type
copy(TIterator1 sb, TIterator1 se, TIterator2 db)
{
typedef typename ETLSTD::iterator_traits<TIterator1>::value_type value_t;
typedef typename etlstd::iterator_traits<TIterator1>::value_type value_t;
return TIterator2(memcpy(db, sb, sizeof(value_t) * (se - sb)));
}
@ -90,7 +80,7 @@ namespace std
template <typename TIterator1, typename TIterator2>
typename etl::enable_if<!etl::is_pointer<TIterator1>::value ||
!etl::is_pointer<TIterator2>::value ||
!etl::is_pod<typename ETLSTD::iterator_traits<TIterator1>::value_type>::value, TIterator2>::type
!etl::is_pod<typename etlstd::iterator_traits<TIterator1>::value_type>::value, TIterator2>::type
copy(TIterator1 sb, TIterator1 se, TIterator2 db)
{
while (sb != se)
@ -107,10 +97,10 @@ namespace std
template <typename TIterator1, typename TSize, typename TIterator2>
typename etl::enable_if<etl::is_pointer<TIterator1>::value &&
etl::is_pointer<TIterator2>::value &&
etl::is_pod<typename ETLSTD::iterator_traits<TIterator1>::value_type>::value, TIterator2>::type
etl::is_pod<typename etlstd::iterator_traits<TIterator1>::value_type>::value, TIterator2>::type
copy_n(TIterator1 sb, TSize count, TIterator2 db)
{
typedef typename ETLSTD::iterator_traits<TIterator1>::value_type value_t;
typedef typename etlstd::iterator_traits<TIterator1>::value_type value_t;
return TIterator2(memcpy(db, sb, sizeof(value_t) * count));
}
@ -119,7 +109,7 @@ namespace std
template <typename TIterator1, typename TSize, typename TIterator2>
typename etl::enable_if<!etl::is_pointer<TIterator1>::value ||
!etl::is_pointer<TIterator2>::value ||
!etl::is_pod<typename ETLSTD::iterator_traits<TIterator1>::value_type>::value, TIterator2>::type
!etl::is_pod<typename etlstd::iterator_traits<TIterator1>::value_type>::value, TIterator2>::type
copy_n(TIterator1 sb, TSize count, TIterator2 db)
{
while (count != 0)
@ -137,10 +127,10 @@ namespace std
template <typename TIterator1, typename TIterator2>
typename etl::enable_if<etl::is_pointer<TIterator1>::value &&
etl::is_pointer<TIterator2>::value &&
etl::is_pod<typename ETLSTD::iterator_traits<TIterator1>::value_type>::value, TIterator2>::type
etl::is_pod<typename etlstd::iterator_traits<TIterator1>::value_type>::value, TIterator2>::type
copy_backward(TIterator1 sb, TIterator1 se, TIterator2 de)
{
typedef typename ETLSTD::iterator_traits<TIterator1>::value_type value_t;
typedef typename etlstd::iterator_traits<TIterator1>::value_type value_t;
const size_t length = (se - sb);
@ -151,7 +141,7 @@ namespace std
template <typename TIterator1, typename TIterator2>
typename etl::enable_if<!etl::is_pointer<TIterator1>::value ||
!etl::is_pointer<TIterator2>::value ||
!etl::is_pod<typename ETLSTD::iterator_traits<TIterator1>::value_type>::value, TIterator2>::type
!etl::is_pod<typename etlstd::iterator_traits<TIterator1>::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<typename TIterator, typename TValue, typename TCompare>
TIterator lower_bound(TIterator first, TIterator last, const TValue& value, TCompare compare)
{
typedef typename ETLSTD::iterator_traits<TIterator>::difference_type difference_t;
typedef typename etlstd::iterator_traits<TIterator>::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<typename TIterator, typename TValue>
TIterator lower_bound(TIterator first, TIterator last, const TValue& value)
{
typedef ETLSTD::less<typename ETLSTD::iterator_traits<TIterator>::value_type> compare;
typedef etlstd::less<typename etlstd::iterator_traits<TIterator>::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<typename TIterator, typename TValue, typename TCompare>
TIterator upper_bound(TIterator first, TIterator last, const TValue& value, TCompare compare)
{
typedef typename ETLSTD::iterator_traits<TIterator>::difference_type difference_t;
typedef typename etlstd::iterator_traits<TIterator>::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<typename TIterator, typename TValue>
TIterator upper_bound(TIterator first, TIterator last, const TValue& value)
{
typedef ETLSTD::less<typename ETLSTD::iterator_traits<TIterator>::value_type> compare;
typedef etlstd::less<typename etlstd::iterator_traits<TIterator>::value_type> compare;
return ETLSTD::upper_bound(first, last, value, compare());
return etlstd::upper_bound(first, last, value, compare());
}
//***************************************************************************
// equal_range
template<typename TIterator, typename TValue, typename TCompare>
ETLSTD::pair <TIterator, TIterator> equal_range(TIterator first, TIterator last, const TValue& value, TCompare compare)
etlstd::pair <TIterator, TIterator> 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<typename TIterator, typename TValue>
ETLSTD::pair<TIterator, TIterator> equal_range(TIterator first, TIterator last, const TValue& value)
etlstd::pair<TIterator, TIterator> equal_range(TIterator first, TIterator last, const TValue& value)
{
typedef ETLSTD::less<typename ETLSTD::iterator_traits<TIterator>::value_type> compare;
typedef etlstd::less<typename etlstd::iterator_traits<TIterator>::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 <typename TIterator1, typename TIterator2>
void iter_swap(TIterator1 a, TIterator2 b)
{
typename ETLSTD::iterator_traits<TIterator1>::value_type c = *a;
typename etlstd::iterator_traits<TIterator1>::value_type c = *a;
*a = *b;
*b = c;
}
@ -421,7 +411,7 @@ namespace std
//***************************************************************************
// equal
template <typename TIterator1, typename TIterator2>
typename etl::enable_if<!etl::is_pointer<TIterator1>::value || !etl::is_pointer<TIterator2>::value || !etl::is_pod<typename ETLSTD::iterator_traits<TIterator1>::value_type>::value, bool>::type
typename etl::enable_if<!etl::is_pointer<TIterator1>::value || !etl::is_pointer<TIterator2>::value || !etl::is_pod<typename etlstd::iterator_traits<TIterator1>::value_type>::value, bool>::type
equal(TIterator1 first1, TIterator1 last1, TIterator2 first2)
{
while (first1 != last1)
@ -436,10 +426,10 @@ namespace std
}
template <typename TIterator1, typename TIterator2>
typename etl::enable_if<etl::is_pointer<TIterator1>::value && etl::is_pointer<TIterator2>::value && etl::is_pod<typename ETLSTD::iterator_traits<TIterator1>::value_type>::value, bool>::type
typename etl::enable_if<etl::is_pointer<TIterator1>::value && etl::is_pointer<TIterator2>::value && etl::is_pod<typename etlstd::iterator_traits<TIterator1>::value_type>::value, bool>::type
equal(TIterator1 first1, TIterator1 last1, TIterator2 first2)
{
typedef typename ETLSTD::iterator_traits<TIterator1>::value_type value_t;
typedef typename etlstd::iterator_traits<TIterator1>::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<typename ETLSTD::iterator_traits<TIterator1>::value_type> compare;
typedef etlstd::less<typename etlstd::iterator_traits<TIterator1>::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 <typename T>
const T& min(const T& a, const T& b)
{
typedef ETLSTD::less<T> compare;
typedef etlstd::less<T> compare;
return ETLSTD::min(a, b, compare());
return etlstd::min(a, b, compare());
}
//***************************************************************************
@ -508,9 +498,9 @@ namespace std
template <typename T>
const T& max(const T& a, const T& b)
{
typedef ETLSTD::less<T> compare;
typedef etlstd::less<T> compare;
return ETLSTD::max(a, b, compare());
return etlstd::max(a, b, compare());
}
//***************************************************************************
@ -612,8 +602,8 @@ namespace std
template <typename TIterator, typename TCompare>
void pop_heap(TIterator first, TIterator last, TCompare compare)
{
typedef typename ETLSTD::iterator_traits<TIterator>::value_type value_t;
typedef typename ETLSTD::iterator_traits<TIterator>::difference_type distance_t;
typedef typename etlstd::iterator_traits<TIterator>::value_type value_t;
typedef typename etlstd::iterator_traits<TIterator>::difference_type distance_t;
value_t value = last[-1];
last[-1] = first[0];
@ -625,17 +615,17 @@ namespace std
template <typename TIterator>
void pop_heap(TIterator first, TIterator last)
{
typedef ETLSTD::less<typename ETLSTD::iterator_traits<TIterator>::value_type> compare;
typedef etlstd::less<typename etlstd::iterator_traits<TIterator>::value_type> compare;
ETLSTD::pop_heap(first, last, compare());
etlstd::pop_heap(first, last, compare());
}
// Push Heap
template <typename TIterator, typename TCompare>
void push_heap(TIterator first, TIterator last, TCompare compare)
{
typedef typename ETLSTD::iterator_traits<TIterator>::difference_type difference_t;
typedef typename ETLSTD::iterator_traits<TIterator>::value_type value_t;
typedef typename etlstd::iterator_traits<TIterator>::difference_type difference_t;
typedef typename etlstd::iterator_traits<TIterator>::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 <typename TIterator>
void push_heap(TIterator first, TIterator last)
{
typedef ETLSTD::less<typename ETLSTD::iterator_traits<TIterator>::value_type> compare;
typedef etlstd::less<typename etlstd::iterator_traits<TIterator>::value_type> compare;
ETLSTD::push_heap(first, last, compare());
etlstd::push_heap(first, last, compare());
}
// Make Heap
template <typename TIterator, typename TCompare>
void make_heap(TIterator first, TIterator last, TCompare compare)
{
typedef typename ETLSTD::iterator_traits<TIterator>::difference_type difference_t;
typedef typename etlstd::iterator_traits<TIterator>::difference_type difference_t;
if ((last - first) < 2)
{
@ -680,16 +670,16 @@ namespace std
template <typename TIterator>
void make_heap(TIterator first, TIterator last)
{
typedef ETLSTD::less<typename ETLSTD::iterator_traits<TIterator>::value_type> compare;
typedef etlstd::less<typename etlstd::iterator_traits<TIterator>::value_type> compare;
ETLSTD::make_heap(first, last, compare());
etlstd::make_heap(first, last, compare());
}
// Is Heap
template <typename TIterator>
bool is_heap(TIterator first, TIterator last)
{
typedef ETLSTD::less<typename ETLSTD::iterator_traits<TIterator>::value_type> compare;
typedef etlstd::less<typename etlstd::iterator_traits<TIterator>::value_type> compare;
return private_heap::is_heap(first, last - first, compare());
}
@ -741,9 +731,9 @@ namespace std
template<typename TIterator1, class TIterator2>
TIterator1 search(TIterator1 first, TIterator1 last, TIterator2 search_first, TIterator2 search_last)
{
typedef ETLSTD::equal_to<typename ETLSTD::iterator_traits<TIterator1>::value_type> compare;
typedef etlstd::equal_to<typename etlstd::iterator_traits<TIterator1>::value_type> compare;
return ETLSTD::search(first, last, search_first, search_last, compare());
return etlstd::search(first, last, search_first, search_last, compare());
}
}

View File

@ -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 <typename T = void>
@ -78,7 +68,7 @@
//***************************************************************************
template <typename TFunction>
class binder1st : public ETLSTD::unary_function<typename TFunction::second_argument_type, typename TFunction::result_type>
class binder1st : public etlstd::unary_function<typename TFunction::second_argument_type, typename TFunction::result_type>
{
protected:
@ -112,7 +102,7 @@
//***************************************************************************
template <typename TFunction >
class binder2nd : public ETLSTD::unary_function<typename TFunction::first_argument_type, typename TFunction::result_type>
class binder2nd : public etlstd::unary_function<typename TFunction::first_argument_type, typename TFunction::result_type>
{
protected:
TFunction operation;

View File

@ -37,17 +37,7 @@ SOFTWARE.
#include <string.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
{
//***************************************************************************
// iterator
@ -106,11 +96,11 @@ namespace std
template <typename TIterator, typename TDistance>
void advance(TIterator& itr, TDistance n)
{
advance_helper(itr, n, typename ETLSTD::iterator_traits<TIterator>::iterator_category());
advance_helper(itr, n, typename etlstd::iterator_traits<TIterator>::iterator_category());
}
template <typename TIterator, typename TDistance>
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 <typename TIterator, typename TDistance>
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 <typename TIterator, typename TDistance>
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 <typename TIterator, typename TDistance>
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 <typename TIterator, typename TDistance>
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 TIterator>
typename ETLSTD::iterator_traits<TIterator>::difference_type distance(TIterator first, TIterator last)
typename etlstd::iterator_traits<TIterator>::difference_type distance(TIterator first, TIterator last)
{
return distance_helper(first, last, typename ETLSTD::iterator_traits<TIterator>::iterator_category());
return distance_helper(first, last, typename etlstd::iterator_traits<TIterator>::iterator_category());
}
template<typename TIterator>
typename ETLSTD::iterator_traits<TIterator>::difference_type distance_helper(TIterator first, TIterator last, ETLSTD::input_iterator_tag)
typename etlstd::iterator_traits<TIterator>::difference_type distance_helper(TIterator first, TIterator last, etlstd::input_iterator_tag)
{
typename ETLSTD::iterator_traits<TIterator>::difference_type d = 0;
typename etlstd::iterator_traits<TIterator>::difference_type d = 0;
while (first != last)
{
@ -184,9 +174,9 @@ namespace std
}
template<typename TIterator>
typename ETLSTD::iterator_traits<TIterator>::difference_type distance_helper(TIterator first, TIterator last, ETLSTD::forward_iterator_tag)
typename etlstd::iterator_traits<TIterator>::difference_type distance_helper(TIterator first, TIterator last, etlstd::forward_iterator_tag)
{
typename ETLSTD::iterator_traits<TIterator>::difference_type d = 0;
typename etlstd::iterator_traits<TIterator>::difference_type d = 0;
while (first != last)
{
@ -198,9 +188,9 @@ namespace std
}
template<typename TIterator>
typename ETLSTD::iterator_traits<TIterator>::difference_type distance_helper(TIterator first, TIterator last, ETLSTD::bidirectional_iterator_tag)
typename etlstd::iterator_traits<TIterator>::difference_type distance_helper(TIterator first, TIterator last, etlstd::bidirectional_iterator_tag)
{
typename ETLSTD::iterator_traits<TIterator>::difference_type d = 0;
typename etlstd::iterator_traits<TIterator>::difference_type d = 0;
while (first != last)
{
@ -212,7 +202,7 @@ namespace std
}
template<typename TIterator>
typename ETLSTD::iterator_traits<TIterator>::difference_type distance_helper(TIterator first, TIterator last, ETLSTD::random_access_iterator_tag)
typename etlstd::iterator_traits<TIterator>::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<TIterator>::difference_type difference_type;
typedef typename ETLSTD::iterator_traits<TIterator>::value_type value_type;
typedef typename ETLSTD::iterator_traits<TIterator>::pointer pointer;
typedef typename ETLSTD::iterator_traits<TIterator>::reference reference;
typedef typename ETLSTD::iterator_traits<TIterator>::iterator_category iterator_category;
typedef typename etlstd::iterator_traits<TIterator>::difference_type difference_type;
typedef typename etlstd::iterator_traits<TIterator>::value_type value_type;
typedef typename etlstd::iterator_traits<TIterator>::pointer pointer;
typedef typename etlstd::iterator_traits<TIterator>::reference reference;
typedef typename etlstd::iterator_traits<TIterator>::iterator_category iterator_category;
reverse_iterator()
{

View File

@ -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 T> class numeric_limits;

View File

@ -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 <typename T1, typename T2>

View File

@ -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

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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_iterator> const_reverse_iterator;
typedef ETLSTD::reverse_iterator<const_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<T, TTraits>& lhs, const etl::basic_string_view<T, TTraits>& 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<T, TTraits>& lhs, const etl::basic_string_view<T, TTraits>& 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());
}
//*************************************************************************

View File

@ -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

View File

@ -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

View File

@ -513,14 +513,14 @@ namespace etl
///\ingroup types
//***************************************************************************
template <typename T,
typename T1, typename T2 = void, typename T3 = void, typename T4 = void,
typename T5 = void, typename T6 = void, typename T7 = void, typename T8 = void,
typename T9 = void, typename T10 = void, typename T11 = void, typename T12 = void,
typename T13 = void, typename T14 = void, typename T15 = void, typename T16 = void,
typename T1, typename T2 = void, typename T3 = void, typename T4 = void,
typename T5 = void, typename T6 = void, typename T7 = void, typename T8 = void,
typename T9 = void, typename T10 = void, typename T11 = void, typename T12 = void,
typename T13 = void, typename T14 = void, typename T15 = void, typename T16 = void,
typename T17 = void>
struct is_one_of
{
static const bool value =
static const bool value =
etl::is_same<T, T1>::value ||
etl::is_same<T, T2>::value ||
etl::is_same<T, T3>::value ||

View File

@ -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_);
}

View File

@ -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_);
}

View File

@ -481,7 +481,7 @@ namespace etl
local_iterator inode;
};
typedef typename std::iterator_traits<iterator>::difference_type difference_type;
typedef typename ETLSTD::iterator_traits<iterator>::difference_type difference_type;
//*********************************************************************
/// Returns an iterator to the beginning of the unordered_map.

Some files were not shown because too many files have changed in this diff Show More