Run the `clang-format.bash` script to update all our C and C++ code to a
new style defined by `.clang-format`, now with "east const" enforcement.
Use `clang-format` version 18.
* 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.
Issue: #26123
Iterate over the object's members and call a filter callable to decide what
to do with the current key/value. A filter returns one of the `FilterResult`
values. A container type is an associative or a sequence container of pairs
(key, value).
Refactor `MapFilter()` and `Map()` to use `FilteredObject()`. Moreover,
for C++ >= 17 implementation is more optimized depending on the given filter
object type and capable of detecting and properly calling the filter callable
using 1 or 3 arguments, up to totally eliminate any checking (even dummy)
in the generated code.
Supported container types, used to append key/value items, aren't limited to
`std::map` only and can be any associative container or a sequenced one with
pairs of key/value as elements.
And use it in the `cmCMakePresetsGraphReadJSON.cxx` to check
presets schema version in the declarative way.
Co-authored-by: Martin Duffy <martin.duffy@kitware.com>
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