cmAlgorithms: Update concept requirement to FowardIterator

This commit is contained in:
Stephen Kelly 2015-02-17 21:59:26 +01:00
parent 09d6125bfe
commit 61fe1919de
1 changed files with 6 additions and 6 deletions

View File

@ -81,14 +81,14 @@ private:
const std::string m_test;
};
template<typename BiDirIt>
BiDirIt cmRotate(BiDirIt first, BiDirIt middle, BiDirIt last)
template<typename FwdIt>
FwdIt cmRotate(FwdIt first, FwdIt middle, FwdIt last)
{
typename std::iterator_traits<BiDirIt>::difference_type dist =
std::distance(first, middle);
typename std::iterator_traits<FwdIt>::difference_type dist =
std::distance(middle, last);
std::rotate(first, middle, last);
std::advance(last, -dist);
return last;
std::advance(first, dist);
return first;
}
namespace ContainerAlgorithms {