From 6b898a670e420cd9247ea6c705f09ea92f26ff66 Mon Sep 17 00:00:00 2001 From: Stephen Nicholas Swatman Date: Wed, 11 Sep 2024 09:57:02 +0200 Subject: [PATCH] refactor: Remove MPL library This commit removes the mostly unused MPL library. The few cases in which it was being used could be easily refactored into uses of fold expressions, which should allow better error messages. Depends on #3573. --- .../include/Acts/Propagator/ActorConcepts.hpp | 5 + Core/include/Acts/Propagator/ActorList.hpp | 32 +- .../detail/actor_list_implementation.hpp | 5 +- Core/include/Acts/Utilities/TypeList.hpp | 61 ++++ .../Acts/Utilities/detail/Extendable.hpp | 8 +- .../Acts/Utilities/detail/MPL/all_of.hpp | 29 -- .../Acts/Utilities/detail/MPL/any_of.hpp | 29 -- .../Acts/Utilities/detail/MPL/are_sorted.hpp | 61 ---- .../Acts/Utilities/detail/MPL/are_within.hpp | 45 --- .../Acts/Utilities/detail/MPL/at_index.hpp | 36 --- .../Utilities/detail/MPL/has_duplicates.hpp | 44 --- .../Utilities/detail/MPL/type_collector.hpp | 108 ------- Tests/UnitTests/Core/Utilities/CMakeLists.txt | 1 - Tests/UnitTests/Core/Utilities/MPLTests.cpp | 295 ------------------ 14 files changed, 87 insertions(+), 672 deletions(-) delete mode 100644 Core/include/Acts/Utilities/detail/MPL/all_of.hpp delete mode 100644 Core/include/Acts/Utilities/detail/MPL/any_of.hpp delete mode 100644 Core/include/Acts/Utilities/detail/MPL/are_sorted.hpp delete mode 100644 Core/include/Acts/Utilities/detail/MPL/are_within.hpp delete mode 100644 Core/include/Acts/Utilities/detail/MPL/at_index.hpp delete mode 100644 Core/include/Acts/Utilities/detail/MPL/has_duplicates.hpp delete mode 100644 Core/include/Acts/Utilities/detail/MPL/type_collector.hpp delete mode 100644 Tests/UnitTests/Core/Utilities/MPLTests.cpp diff --git a/Core/include/Acts/Propagator/ActorConcepts.hpp b/Core/include/Acts/Propagator/ActorConcepts.hpp index d83119135eab..559d0fee17f1 100644 --- a/Core/include/Acts/Propagator/ActorConcepts.hpp +++ b/Core/include/Acts/Propagator/ActorConcepts.hpp @@ -17,6 +17,11 @@ namespace Acts { template concept ActorHasResult = requires { typename actor_t::result_type; }; +template +struct ActorHasResultStruct { + static constexpr bool value = ActorHasResult; +}; + template concept ActorHasActWithoutResult = requires( diff --git a/Core/include/Acts/Propagator/ActorList.hpp b/Core/include/Acts/Propagator/ActorList.hpp index 1101caf2682c..19ad73786d48 100644 --- a/Core/include/Acts/Propagator/ActorList.hpp +++ b/Core/include/Acts/Propagator/ActorList.hpp @@ -9,16 +9,14 @@ #pragma once #include "Acts/Propagator/detail/actor_list_implementation.hpp" -#include "Acts/Utilities/detail/MPL/all_of.hpp" -#include "Acts/Utilities/detail/MPL/has_duplicates.hpp" -#include "Acts/Utilities/detail/MPL/type_collector.hpp" - -#include -#include - -namespace hana = boost::hana; +#include "Acts/Utilities/TypeList.hpp" namespace Acts { +/// @brief Extract the result type of an actor +template +struct ActorResultTypeExtractor { + using type = T::result_type; +}; /// @brief ActorList implementation to be used with the propagator /// @@ -26,18 +24,20 @@ namespace Acts { /// to define a list of different actors_t that are each /// executed during the stepping procedure template - requires( - detail::all_of_v::value...> && - detail::all_of_v::value...> && - detail::all_of_v::value...> && - !detail::has_duplicates_v) + requires((std::is_default_constructible::value && ...) && + (std::is_copy_constructible::value && ...) && + (std::is_move_constructible::value && ...) && + ((Types::count>::value == 1) && ...)) struct ActorList { /// @cond // This uses the type collector and unpacks using the `R` meta function + // template