Commit Graph

30 Commits

Author SHA1 Message Date
Brad King
b3ca4f9ad1 cm/filesystem: Work around crash when compiled for CYGWIN/MSYS runtime
Issue: #22090
2021-04-26 14:27:34 -04:00
Brad King
b7d4ee23d8 cm::optional: Fix -Wunused-parameter warnings in comparison operators 2021-01-25 14:44:09 -05:00
Kyle Edwards
67383725bd cm::optional: Add constructor delegation to nullopt_t constructor
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.
2020-10-22 11:40:48 -04:00
Kyle Edwards
0668120398 cm::optional: Fix move assignment 2020-10-21 14:23:43 -04:00
Marc Chevrier
82c9508313 cmake_path: enhancements
* Fix error on parsing "c:a" (root-name without root-directory)
* Enrich documentation
2020-09-20 15:17:34 +02:00
Kyle Edwards
1d74a64f38 Merge topic 'cm-optional-comparison'
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
2020-09-08 09:55:18 -04:00
Kyle Edwards
7e1304c6e6 cm::optional: Add comparison operators 2020-09-07 08:50:09 -04:00
Marc Chevrier
212e953d35 cmCMakePath: Class for path handling 2020-09-06 10:34:17 +02:00
Kitware Robot
bdca8b01d2 Modernize: Use #pragma once in all header files
#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.
2020-09-03 09:30:21 -04:00
Fred Baksik
bfed613132 STL Support: Fix cm::filesystem warnings; check for '\' not multichar ' \'.
Utilities/std/cm/bits/fs_path.cxx:334:24: warning: multi-character character constant [-Wmultichar]
             || *ptr == ' \\'
                        ^~~~~
2020-07-24 19:36:46 -04:00
Marc Chevrier
259356f3b5 STL Support: cm::filesystem::path: add support of Cygwin 2020-07-20 16:20:42 +02:00
Marc Chevrier
d654bf3449 STL Support: Add cm::filesystem::path in <cm/filesystem> 2020-07-09 17:02:42 +02:00
Marc Chevrier
e5798126fc STL Support: introduce dedicated configuration file 2020-07-09 15:24:43 +02:00
Marc Chevrier
4408f34cfe STL Support: Add function cm::quoted in <cm/iomanip> 2020-07-09 15:24:43 +02:00
Sumit Bhardwaj
782d7387d5 Implement cm::static_reference_cast by declval
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.
2020-07-04 11:03:46 -07:00
Marc Chevrier
2faa3f6c55 Refactoring: Third-parties public headers are under cm3p prefix
Fixes: #20666
2020-05-07 12:06:08 +02:00
Marc Chevrier
8d4a9ee398 Refactoring: rename "cm_static_string_view.hxx" as <cmext/string_view> 2020-04-30 09:53:27 +02:00
Marc Chevrier
aacd4e4a90 Refactoring: add cm::contains to <cmext/algorithm> 2020-04-17 10:00:03 +02:00
Marc Chevrier
f034b0f663 CMake compilation: do not use compiler extensions
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.
2020-03-23 10:29:58 +01:00
Marc Chevrier
fa828b8fba STL support: make_unique can now handle array 2020-01-28 17:38:17 +01:00
Marc Chevrier
73d1da4f86 Stl support: cm::append now supports any sequential container 2020-01-24 15:55:32 +01:00
Marc Chevrier
b9a3f2e7e2 STL Support: enhance behavior of cm::dynamic_reference_cast
Ensure cm::dynamic_reference_cast has same behavior as dynamic_cast
on reference: raise std::bad_cast if dynamic_cast is not possible.
2020-01-17 11:09:53 +01:00
Marc Chevrier
04c2f67492 STL Support: extends type_traits for future developments 2020-01-17 11:09:48 +01:00
Marc Chevrier
348b60d19d STL support: add c++20 std::erase and std::erase_if functions 2020-01-08 17:35:16 +01:00
Marc Chevrier
a38d04c076 Refactoring: introduce header cmext/algorithm with append functions 2019-12-17 10:43:58 +01:00
Marc Chevrier
fc3b4caa2e Memory management: cast functions for managed pointers 2019-11-27 16:03:04 +01:00
Kitware Robot
ed98209ddc Revise include order using clang-format-6.0
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.
2019-10-01 12:26:36 -04:00
Regina Pfeifer
6a05bd3fa6 cm/algorithm: Provide function cm::clamp 2019-09-25 10:30:58 +02:00
Marc Chevrier
4a08690ccf cmstd: Extend header <cm/iterator> 2019-09-20 10:01:56 -04:00
Marc Chevrier
c688b401d3 cmstd: Modernize CMake system headers
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
2019-09-20 10:01:37 -04:00