summaryrefslogtreecommitdiffstats
path: root/Source/cmAlgorithms.h
Commit message (Collapse)AuthorAgeFilesLines
* cmAlgorithms: Add cmRemoveMatching algorithm.Stephen Kelly2015-02-151-0/+24
| | | | | Implement it in terms of std::remove_if with a binary search through a matching range.
* cmAlgorithms: Implement algorithm for removing indexes.Stephen Kelly2015-02-151-0/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | Implement ContainerAlgorithms::RemoveN to remove N elements to the end of a container by rotating. The rotate is implemented in terms of the efficient swap algorithm, optimized even more in the standard library implementation when the compiler supports the rvalue-references feature to move elements. Implement cmRemoveN with a Range API for completeness. std::rotate in C++11 is specified to return an iterator, but c++98 specifies it to return void. libstdc++ 5.0 will be the first version to have the correct return type. Implement ContainerAlgorithms::Rotate in terms of std::rotate and return the correct iterator from it. While std::rotate requires forward iterators, this workaround means cmRotate requires bidirectional iterators. As most of CMake uses random access iterators anyway, this should not be a problem. Implement cmRemoveIndices in terms of the RemoveN algorithm, such that each element which is not removed is rotated only once. This can not use the cmRemoveN range-API algorithm because that would require creating a new range, but the range must be taken by reference and so it can't be a temporary. These remove algorithms are not part of the STL and I couldn't find them anywhere else either.
* cmAlgorithms: Add a range adaptor and API for adjusting a range.Stephen Kelly2015-02-111-0/+19
|
* cmAlgorithms: Add a Range container and adaptor method.Stephen Kelly2015-02-111-0/+21
| | | | | | | | This can make a pair of iterators API compatible with the cmJoin algorithm and other range-based algorithms. Accept different iterator types in the cmRange adaptor so that a const and non-const iterator are accepted.
* Split cmAlgorithms into a separate header file.Stephen Kelly2015-02-101-0/+151