diff options
author | Stephen Kelly <steveire@gmail.com> | 2015-02-17 21:04:25 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2015-02-20 20:36:58 (GMT) |
commit | 4afe6c26c66556827e6089982c49b8dea3a2efcb (patch) | |
tree | d2611a502cd91cfb57be1dab63cd12d7d422ea39 /Source/cmAlgorithms.h | |
parent | a3a0a8c222b59f15502f52192bf41c4af2882392 (diff) | |
download | CMake-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.h | 8 |
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 |