summaryrefslogtreecommitdiffstats
path: root/Utilities/std
Commit message (Collapse)AuthorAgeFilesLines
* Revise C++ coding style using clang-format-15Kitware Robot2023-01-183-26/+22
| | | | | | | | | | | | | | 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 15. * 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. Fixes: #24315
* Merge topic 'filesystem-path-c++03-abi'Brad King2022-10-211-10/+6
|\ | | | | | | | | | | | | | | ee9805ccd1 cm/filesystem: Fix crash with pre-C++11 std::string GNU ABI in C++17 Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !7813
| * cm/filesystem: Fix crash with pre-C++11 std::string GNU ABI in C++17Brad King2022-10-201-10/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `remove_filename` and `replace_extension` methods compute an offset between the whole path in a `std::string` and a part of a path in a `std::string_view`. This is done by subtracting their `.data()` pointers. However, C++17 adds a non-const `.data()` through which modification of the string is allowed. This means the copy-on-write implementation used by the pre-C++11 std::string GNU ABI must reallocate if the string has been copied. Our subtraction then computes an offset between two different allocations, which is undefined behavior. The workaround in commit b3ca4f9ad1 (cm/filesystem: Work around crash when compiled for CYGWIN/MSYS runtime, 2021-04-22, v3.21.0-rc1~271^2~2) avoided the problem by calling the non-const `.data()` to reallocate before constructing the `string_view`. Instead, explicitly call the const `.data()` method on the string, which does not reallocate. Fixes: #22090, #23328
* | cm::enum_set: fix various bugsMarc Chevrier2022-08-221-5/+8
| |
* | stl containers: enhance compatibility with C++14, C++17 and C++20Marc Chevrier2022-05-0713-189/+338
| | | | | | | | | | | | * Ensure various functions working with containers are available through all headers as specified by the standard. * Add C++20 std::ssize() function.
* | cm::enum_set: fix compilation warningMarc Chevrier2022-04-291-1/+5
| |
* | cm::enum_set: container that contains a set of unique enum values.Marc Chevrier2022-04-271-0/+393
|/ | | | The enum must be an `enum class` with an unsigned integer as base type.
* cm/filesystem: Work around crash when compiled for CYGWIN/MSYS runtimeBrad King2021-04-261-0/+8
| | | | Issue: #22090
* cm::optional: Fix `-Wunused-parameter` warnings in comparison operatorsBrad King2021-01-251-4/+4
|
* cm::optional: Add constructor delegation to nullopt_t constructorKyle Edwards2020-10-221-0/+1
| | | | | | Some static analysis tools incorrectly identify this constructor as leaving _has_value in an undefined state. Explicitly call the default constructor to force _has_value to false.
* cm::optional: Fix move assignmentKyle Edwards2020-10-211-13/+34
|
* cmake_path: enhancementsMarc Chevrier2020-09-201-2/+3
| | | | | * Fix error on parsing "c:a" (root-name without root-directory) * Enrich documentation
* Merge topic 'cm-optional-comparison'Kyle Edwards2020-09-081-0/+204
|\ | | | | | | | | | | | | | | 7e1304c6e6 cm::optional: Add comparison operators c854e9eba5 Refactor: Add ASSERT_TRUE() macro to testOptional.cxx Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5195
| * cm::optional: Add comparison operatorsKyle Edwards2020-09-071-0/+204
| |
* | cmCMakePath: Class for path handlingMarc Chevrier2020-09-062-3/+3
|/
* Modernize: Use #pragma once in all header filesKitware Robot2020-09-0325-99/+25
| | | | | | | | | | | | | | | | #pragma once is a widely supported compiler pragma, even though it is not part of the C++ standard. Many of the issues keeping #pragma once from being standardized (distributed filesystems, build farms, hard links, etc.) do not apply to CMake - it is easy to build CMake on a single machine. CMake also does not install any header files which can be consumed by other projects (though cmCPluginAPI.h has been deliberately omitted from this conversion in case anyone is still using it.) Finally, #pragma once has been required to build CMake since at least August 2017 (7f29bbe6 enabled server mode unconditionally, which had been using #pragma once since September 2016 (b13d3e0d)). The fact that we now require C++11 filters out old compilers, and it is unlikely that there is a compiler which supports C++11 but does not support #pragma once.
* STL Support: Fix cm::filesystem warnings; check for '\' not multichar ' \'.Fred Baksik2020-07-241-1/+1
| | | | | | Utilities/std/cm/bits/fs_path.cxx:334:24: warning: multi-character character constant [-Wmultichar] || *ptr == ' \\' ^~~~~
* STL Support: cm::filesystem::path: add support of CygwinMarc Chevrier2020-07-202-17/+59
|
* STL Support: Add cm::filesystem::path in <cm/filesystem>Marc Chevrier2020-07-094-1/+2166
|
* STL Support: introduce dedicated configuration fileMarc Chevrier2020-07-092-0/+12
|
* STL Support: Add function cm::quoted in <cm/iomanip>Marc Chevrier2020-07-091-0/+183
|
* Implement cm::static_reference_cast by declvalSumit Bhardwaj2020-07-041-8/+9
| | | | | | | | Previously, cm::static_reference_cast used invoke_result_t and took the address of O::get. This is not in complete conformance with standard. This MR changes the implementation to use std::declval<O>.get() which is always well-defined.
* Refactoring: Third-parties public headers are under cm3p prefixMarc Chevrier2020-05-072-2/+2
| | | | Fixes: #20666
* Refactoring: rename "cm_static_string_view.hxx" as <cmext/string_view>Marc Chevrier2020-04-302-1/+44
|
* Refactoring: add cm::contains to <cmext/algorithm>Marc Chevrier2020-04-173-11/+103
|
* CMake compilation: do not use compiler extensionsMarc Chevrier2020-03-231-0/+4
| | | | | | | For now, compiler extensions are no longer activated on CMake sources. However these extensions are still used for various third parties. This MR is a partial answer to the issue #20454.
* STL support: make_unique can now handle arrayMarc Chevrier2020-01-281-1/+36
|
* Stl support: cm::append now supports any sequential containerMarc Chevrier2020-01-242-16/+145
|
* STL Support: enhance behavior of cm::dynamic_reference_castMarc Chevrier2020-01-171-1/+9
| | | | | Ensure cm::dynamic_reference_cast has same behavior as dynamic_cast on reference: raise std::bad_cast if dynamic_cast is not possible.
* STL Support: extends type_traits for future developmentsMarc Chevrier2020-01-172-0/+78
|
* STL support: add c++20 std::erase and std::erase_if functionsMarc Chevrier2020-01-0810-2/+369
|
* Refactoring: introduce header cmext/algorithm with append functionsMarc Chevrier2019-12-173-0/+108
|
* Memory management: cast functions for managed pointersMarc Chevrier2019-11-273-0/+79
|
* Revise include order using clang-format-6.0Kitware Robot2019-10-011-2/+2
| | | | | Run the `clang-format.bash` script to update our C and C++ code to a new include order `.clang-format`. Use `clang-format` version 6.0.
* cm/algorithm: Provide function cm::clampRegina Pfeifer2019-09-251-0/+38
|
* cmstd: Extend header <cm/iterator>Marc Chevrier2019-09-201-0/+138
|
* cmstd: Modernize CMake system headersMarc Chevrier2019-09-209-0/+1094
Provide a standardized way to handle the C++ "standard" headers customized to be used with current CMake C++ standard constraints. Offer under directory `cm` headers which can be used as direct replacements of the standard ones. For example: #include <cm/string_view> can be used safely for CMake development in place of the `<string_view>` standard header. Fixes: #19491