cmAlgorithms: Update concept requirement to FowardIterator
This commit is contained in:
parent
09d6125bfe
commit
61fe1919de
|
@ -81,14 +81,14 @@ private:
|
||||||
const std::string m_test;
|
const std::string m_test;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename BiDirIt>
|
template<typename FwdIt>
|
||||||
BiDirIt cmRotate(BiDirIt first, BiDirIt middle, BiDirIt last)
|
FwdIt cmRotate(FwdIt first, FwdIt middle, FwdIt last)
|
||||||
{
|
{
|
||||||
typename std::iterator_traits<BiDirIt>::difference_type dist =
|
typename std::iterator_traits<FwdIt>::difference_type dist =
|
||||||
std::distance(first, middle);
|
std::distance(middle, last);
|
||||||
std::rotate(first, middle, last);
|
std::rotate(first, middle, last);
|
||||||
std::advance(last, -dist);
|
std::advance(first, dist);
|
||||||
return last;
|
return first;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace ContainerAlgorithms {
|
namespace ContainerAlgorithms {
|
||||||
|
|
Loading…
Reference in New Issue