From bc39ecc0385dd7e0cb9e1df84628e4c6dde34ab5 Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Tue, 27 Aug 2024 11:14:38 +0200 Subject: Reformat code to comply with clang-format 18 ... while keeping our .clang-format file. --- src/utils/cpp/concepts.hpp | 59 +++++++++++++++++++++++----------------------- 1 file changed, 30 insertions(+), 29 deletions(-) (limited to 'src/utils/cpp/concepts.hpp') diff --git a/src/utils/cpp/concepts.hpp b/src/utils/cpp/concepts.hpp index 548fb960..90946762 100644 --- a/src/utils/cpp/concepts.hpp +++ b/src/utils/cpp/concepts.hpp @@ -22,71 +22,72 @@ // TODO(modernize): remove this once std::derived_from is shipped with libcxx template -concept derived_from = std::is_base_of_v&& +concept derived_from = + std::is_base_of_v && std::is_convertible_v; // TODO(modernize): remove this once std::same_as is shipped with libcxx template -concept same_as = std::is_same_vand std::is_same_v; +concept same_as = std::is_same_v and std::is_same_v; template -concept ContainsString = requires { - typename T::value_type; -} -and std::is_same_v; +concept ContainsString = requires { typename T::value_type; } and + std::is_same_v; template concept HasSize = requires(T const c) { - { c.size() } - ->same_as; // TODO(modernize): replace by std::same_as + { + c.size() + } -> same_as; // TODO(modernize): replace by std::same_as }; template concept HasToString = requires(T const t) { - { t.ToString() } - ->same_as; // TODO(modernize): replace by std::same_as + { + t.ToString() + } -> same_as; // TODO(modernize): replace by std::same_as }; template concept InputIterableContainer = requires(T const c) { - { c.begin() } - ->same_as; // TODO(modernize): replace by - // std::input_iterator - { c.end() } - ->same_as; // TODO(modernize): replace by - // std::input_iterator + { + c.begin() + } -> same_as; // TODO(modernize): replace by + // std::input_iterator + { + c.end() + } -> same_as; // TODO(modernize): replace by + // std::input_iterator }; template -concept OutputIterableContainer = InputIterableContainerand requires(T c) { - { std::inserter(c, c.begin()) } - ->same_as>; // TODO(modernize): replace by - // std::output_iterator +concept OutputIterableContainer = InputIterableContainer and requires(T c) { + { + std::inserter(c, c.begin()) + } -> same_as>; // TODO(modernize): replace by + // std::output_iterator }; template concept InputIterableStringContainer = - InputIterableContainerand ContainsString; + InputIterableContainer and ContainsString; // TODO(modernize): remove this once we require clang version >= 14.0.0 template concept ClockHasFromSys = requires(std::chrono::time_point const tp) { - T::from_sys(tp); -}; + T::from_sys(tp); + }; // TODO(modernize): remove this once we require clang version >= 14.0.0 template -concept ClockHasFromTime = requires(std::time_t const t) { - T::from_time_t(t); -}; +concept ClockHasFromTime = requires(std::time_t const t) { T::from_time_t(t); }; template concept StrMapConstForwardIterator = requires(T const c) { { - std::remove_reference_t { (*c).first } - } - ->same_as; + std::remove_reference_t{(*c).first} + } -> same_as; }; #endif // INCLUDED_SRC_UTILS_CPP_CONCEPTS_HPP -- cgit v1.2.3