summaryrefslogtreecommitdiffstats
path: root/Source/cmAlgorithms.h
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-02-17 21:04:25 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-02-20 20:36:58 (GMT)
commit4afe6c26c66556827e6089982c49b8dea3a2efcb (patch)
treed2611a502cd91cfb57be1dab63cd12d7d422ea39 /Source/cmAlgorithms.h
parenta3a0a8c222b59f15502f52192bf41c4af2882392 (diff)
downloadCMake-4afe6c26c66556827e6089982c49b8dea3a2efcb.zip
CMake-4afe6c26c66556827e6089982c49b8dea3a2efcb.tar.gz
CMake-4afe6c26c66556827e6089982c49b8dea3a2efcb.tar.bz2
cmAlgorithms: Add cmReverseRange adaptor.
Use it to implement list(REVERSE).
Diffstat (limited to 'Source/cmAlgorithms.h')
-rw-r--r--Source/cmAlgorithms.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/Source/cmAlgorithms.h b/Source/cmAlgorithms.h
index d88de1e..b9bd67b 100644
--- a/Source/cmAlgorithms.h
+++ b/Source/cmAlgorithms.h
@@ -302,4 +302,12 @@ typename Range::const_iterator cmFindNot(Range const& r, T const& t)
std::bind1st(std::not_equal_to<T>(), t));
}
+template<typename Range>
+ContainerAlgorithms::Range<typename Range::const_reverse_iterator>
+cmReverseRange(Range const& range)
+{
+ return ContainerAlgorithms::Range<typename Range::const_reverse_iterator>(
+ range.rbegin(), range.rend());
+}
+
#endif