Add NO_STL std::reverse implementation (#174)

Follows the example implementation on [1].

[1] https://en.cppreference.com/w/cpp/algorithm/reverse
This commit is contained in:
Grigori Goronzy 2019-11-30 12:42:26 +01:00 committed by John Wellbelove
parent 2591d49845
commit 23616de771

View File

@ -156,6 +156,17 @@ namespace ETLSTD
return de;
}
//***************************************************************************
// reverse
template<typename TIterator>
void reverse(TIterator first, TIterator last)
{
while ((first != last) && (first != --last))
{
ETLSTD::swap(*first++, *last);
}
}
//***************************************************************************
// move
template <typename TIterator1, typename TIterator2>