mirror of
https://github.com/ETLCPP/etl.git
synced 2026-06-30 22:38:44 +08:00
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:
parent
2591d49845
commit
23616de771
@ -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>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user