summaryrefslogtreecommitdiffstats
path: root/Source/cmAlgorithms.h
Commit message (Collapse)AuthorAgeFilesLines
* cmAlgorithms: Refactor cmRemoveDuplicatesArtur Ryt2019-03-061-18/+36
| | | | | | | | Use an iterator-based implementation with range-based one simply deferring to it. Also optimize a little by storing iterators to unique values to prevent creating value copies.
* cmRange: Move to dedicated header fileRegina Pfeifer2019-02-211-65/+2
|
* Merge topic 'fix-legacy-implicit-includes'Brad King2019-02-141-0/+8
|\ | | | | | | | | | | | | | | | | | | 6fc3382944 Update logic for sysroot in detected implicit include directories 2ad14ef4ea cmAlgorithms: Add cmHasPrefix to match existing cmHasSuffix 557b2d6e65 Fix regression in -I/usr/include exclusion logic 017598a444 macOS: Fix addition of <sdk>/usr/include to default implicit include dirs Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2957
| * cmAlgorithms: Add cmHasPrefix to match existing cmHasSuffixBrad King2019-02-131-0/+8
| |
* | cmAlgorithms: Make cmRange advance/retreat safe for rvaluesArtur Ryt2019-02-071-3/+15
|/ | | | | | | In rvalue context these functions have to return cmRange by copy instead of reference to temporary object It allows to use ranged-for over cmMakeRange(xxx).advance(yyy)
* clang-tidy: Pass by valueRegina Pfeifer2019-01-221-2/+2
|
* cmAlgorithms: add utility functions to get signed size of containersBruno Manganelli2018-12-271-0/+6
|
* Revise C++ coding style using clang-format-6.0Kitware Robot2018-06-011-10/+10
| | | | | | | | | | | | Run the `clang-format.bash` script to update all our C and C++ code to a new style defined by `.clang-format`. Use `clang-format` version 6.0. * If you reached this commit for a line in `git blame`, re-run the blame operation starting at the parent of this commit to see older history for the content. * See the parent commit for instructions to rebase a change across this style transition commit.
* cmAlgorithms: Speed up cmRemoveDuplicates methodLe Minh Phuc2018-05-251-41/+6
| | | | | | Use a hash table instead of a sorted vector to track entries. Co-authored-by: Chu Qinghao <me@qinghao1.com>
* cmAlgorithms: Remove unnecessary typename keywordjrp20142018-04-051-1/+1
|
* Replace cmArray{Begin,End,Size} by their standard counterpartsMatthias Maennich2017-10-231-16/+61
| | | | | | | | | | | std::{begin,end} are part of C++11, std::{cbegin,cend} are part of C++14 and an standard compliant implementation has been introduced within the 'cm' namespace: cm::{cbegin,cend}. std::size is only part of C++17, hence exposing a compliant implementation within namespace cm (cm::size). where possible, the standard implementations are reused.
* Avoid using std::bind1st that is removed in C++17Brad King2017-09-231-2/+1
| | | | Use a lambda instead now that we require C++11.
* clang-format: format all code as Cpp11Daniel Pfeifer2017-08-301-1/+1
|
* server: backport to C++11Daniel Pfeifer2017-08-261-0/+19
|
* cmAlgorithms: pass std::string by const refDaniel Pfeifer2017-04-211-1/+2
|
* Use quotes for non-system includesDaniel Pfeifer2017-04-111-2/+2
| | | | | | | | | | | | | Automate with: git grep -l '#include <cm_' -- Source \ | xargs sed -i 's/#include <\(cm_.*\)>/#include "\1"/g' git grep -l '#include <cmsys/' -- Source \ | xargs sed -i 's/#include <\(cmsys\/.*\)>/#include "\1"/g' git grep -l '#include <cm[A-Z]' -- Source \ | xargs sed -i 's/#include <\(cm[A-Z].*\)>/#include "\1"/g'
* cmAlgorithms: add cmEraseIf functionDaniel Pfeifer2017-02-101-0/+6
|
* clang-tidy: apply performance-unnecessary-value-param fixesDaniel Pfeifer2016-12-121-4/+4
|
* Fix several include-what-you-use findingsDaniel Pfeifer2016-11-081-3/+11
|
* Simplify CMake per-source license noticesBrad King2016-09-271-11/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Per-source copyright/license notice headers that spell out copyright holder names and years are hard to maintain and often out-of-date or plain wrong. Precise contributor information is already maintained automatically by the version control tool. Ultimately it is the receiver of a file who is responsible for determining its licensing status, and per-source notices are merely a convenience. Therefore it is simpler and more accurate for each source to have a generic notice of the license name and references to more detailed information on copyright holders and full license terms. Our `Copyright.txt` file now contains a list of Contributors whose names appeared source-level copyright notices. It also references version control history for more precise information. Therefore we no longer need to spell out the list of Contributors in each source file notice. Replace CMake per-source copyright/license notice headers with a short description of the license and links to `Copyright.txt` and online information available from "https://cmake.org/licensing". The online URL also handles cases of modules being copied out of our source into other projects, so we can drop our notices about replacing links with full license text. Run the `Utilities/Scripts/filter-notices.bash` script to perform the majority of the replacements mechanically. Manually fix up shebang lines and trailing newlines in a few files. Manually update the notices in a few files that the script does not handle.
* make sure to include cmConfigure.h before cmStandardIncludes.hDaniel Pfeifer2016-09-031-0/+2
|
* Ninja: Support embedding of CMake as subninja projectNicolas Despres2016-05-171-0/+15
| | | | | | Add a `CMAKE_NINJA_OUTPUT_PATH_PREFIX` variable. When it is set, CMake generates a `build.ninja` file suitable for embedding into another ninja project potentially generated by an alien generator.
* Revise C++ coding style using clang-formatKitware Robot2016-05-161-103/+113
| | | | | | | | | | | | | Run the `Utilities/Scripts/clang-format.bash` script to update all our C++ code to a new style defined by `.clang-format`. Use `clang-format` version 3.8. * If you reached this commit for a line in `git blame`, re-run the blame operation starting at the parent of this commit to see older history for the content. * See the parent commit for instructions to rebase a change across this style transition commit.
* cmAlgorithms.h: remove superfluous semicolon after methodChristoph GrĂ¼ninger2016-02-011-1/+1
|
* Remove temporary allocations when calling cmHasLiteral{Suf,Pre}fix.Milian Wolff2016-01-201-2/+2
| | | | | | | | | When the first argument passed is a std::string, we need to take it by const&, otherwise we copy the string and trigger a temporary allocation. This patch removes a few 10k temporary allocations when running the CMake daemon on the KDevelop build dir. This hotspot was found with heaptrack.
* Port CMake from cmIML to KWIMLBrad King2015-12-181-2/+2
| | | | KWIML no longer uses a configured prefix.
* cmAlgorithms: Add cmMakeReverseIterator.Stephen Kelly2015-07-221-0/+6
|
* cmAlgorithms: Add some convenient typedefs.Stephen Kelly2015-07-221-0/+6
|
* cmAlgorithms: Move Range type out of private namespace.Stephen Kelly2015-07-221-35/+35
|
* cmAlgorithms: Rename cmRange to cmMakeRange.Stephen Kelly2015-07-221-2/+2
|
* Merge topic 'cmRemoveDuplicates-improvement'Brad King2015-03-121-6/+36
|\ | | | | | | | | | | | | 8701a3f4 cmRemoveDuplicates: Partially specialize the API for pointer types. eec7091d cmRemoveDuplicates: Type-parameterize all uniq-operations 7cbafa8c cmRemoveDuplicates: Store unique iterators instead of values.
| * cmRemoveDuplicates: Partially specialize the API for pointer types.Stephen Kelly2015-03-101-1/+13
| | | | | | | | | | | | | | | | If de-duplicating a container of pointers, there is no need to store iterators to them, as that is just more 'pointer chasing'. Store the pointers themselves and use API which compares the pointers in the specialization.
| * cmRemoveDuplicates: Type-parameterize all uniq-operationsStephen Kelly2015-03-101-11/+22
| |
| * cmRemoveDuplicates: Store unique iterators instead of values.Stephen Kelly2015-03-101-6/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is no need to copy all of the values in the container in order to determine uniqueness. Iterators can be stored instead and can be used with standard algorithms with custom comparison methods. This also means that we use less space in case the value_type size is greater than sizeof(iterator). That is common for std::string which may require up to 32 bytes (libstdc++ 5.0 and MSVC at least). With libstdc++ 4.9 and older, std::string is 8 bytes, so we likely don't gain anything here. Inspired-by: Daniel Pfeifer <daniel@pfeifer-mail.de>
* | Merge topic 'cmAlgorithms-cleanup'Brad King2015-03-121-1/+1
|\ \ | |/ | | | | | | | | | | 95dd238f cmRemoveDuplicates: Fix iterator -> const_iterator. 4448f175 cmInstalledFile: Move Property implementation out of line. 7916d7ba Include cmAlgorithms where it is used.
| * cmRemoveDuplicates: Fix iterator -> const_iterator.Stephen Kelly2015-03-101-1/+1
| |
* | cmAlgorithms: Add early return in cmRemoveIndices.Stephen Kelly2015-03-101-1/+5
|/ | | | | Avoid derefencing the iterator and segfaulting if the range is empty.
* cmAlgorithms: Cache the end iterators in algorithms.Stephen Kelly2015-02-241-4/+7
|
* cmAlgorithms: Remove needless assignment.Stephen Kelly2015-02-241-2/+1
|
* cmAlgorithms: Maintain the pivot iterator in cmRemoveIndices.Stephen Kelly2015-02-241-2/+4
| | | | | Avoid the algorithm of 'Schlemiel the painter' in the case of iterators which are not RandomAccess.
* cmAlgorithms: Relax iterator requirement for cmRemoveIndices.Stephen Kelly2015-02-241-2/+5
| | | | Require only forward iterators from the range.
* cmAlgorithms: Make cmRemoveDuplicates work with more containers.Stephen Kelly2015-02-241-2/+3
| | | | | Remove the accidental requirement that the input range must be a std::vector.
* cmAlgorithms: Rename template argument to RemoveN.Stephen Kelly2015-02-241-3/+3
|
* cmAlgorithms: Relax cmRemoveN requirement to FwdIter.Stephen Kelly2015-02-241-1/+3
| | | | cmRotate already requires only FwdIter.
* cmAlgorithms: Add a size() to cmRange.Stephen Kelly2015-02-241-0/+3
| | | | | size() is already used by cmRemoveDuplicates, which is designed to accept a cmRange.
* cmAlgorithms: Rename template type in cmDeleteAll algorithm.Stephen Kelly2015-02-231-10/+10
| | | | It may be any range, not only a container.
* cmAlgorithms: Add const to const objects.Stephen Kelly2015-02-231-3/+3
|
* cmAlgorithms: Add cmReverseRange adaptor.Stephen Kelly2015-02-201-0/+8
| | | | Use it to implement list(REVERSE).
* cmAlgorithms: Add cmFindNot algorithm.Stephen Kelly2015-02-201-0/+7
|
* cmAlgorithms: Update concept requirement to FowardIteratorStephen Kelly2015-02-201-6/+6
|