diff options
author | Stephen Kelly <steveire@gmail.com> | 2015-02-17 20:59:26 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2015-02-20 20:36:58 (GMT) |
commit | 61fe1919de8c0455a6baff543ccfcb35fce8f37b (patch) | |
tree | 2afc8eae9419e540d76301a7c0e660e35c80d58a /Source/cmAlgorithms.h | |
parent | 09d6125bfe4034f332956f4bcc5b0a1ba0b82e27 (diff) | |
download | CMake-61fe1919de8c0455a6baff543ccfcb35fce8f37b.zip CMake-61fe1919de8c0455a6baff543ccfcb35fce8f37b.tar.gz CMake-61fe1919de8c0455a6baff543ccfcb35fce8f37b.tar.bz2 |
cmAlgorithms: Update concept requirement to FowardIterator
Diffstat (limited to 'Source/cmAlgorithms.h')
-rw-r--r-- | Source/cmAlgorithms.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Source/cmAlgorithms.h b/Source/cmAlgorithms.h index 30a062a..53e2dc8 100644 --- a/Source/cmAlgorithms.h +++ b/Source/cmAlgorithms.h @@ -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 { |