Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove pre-C++20 std::identity implementation #3599

Merged
merged 2 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions Core/include/Acts/TrackFitting/detail/GsfComponentMerging.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include "Acts/Definitions/TrackParametrization.hpp"
#include "Acts/Surfaces/CylinderSurface.hpp"
#include "Acts/TrackFitting/GsfOptions.hpp"
#include "Acts/Utilities/Identity.hpp"
#include "Acts/Utilities/detail/periodic.hpp"

#include <cmath>
Expand Down Expand Up @@ -123,7 +122,7 @@ auto gaussianMixtureCov(const components_t components,
/// std::tuple< weight, mean, std::optional< cov > >
/// @tparam angle_desc_t A angle description object which defines the cyclic
/// angles in the bound parameters
template <typename components_t, typename projector_t = Identity,
template <typename components_t, typename projector_t = std::identity,
typename angle_desc_t = AngleDescription<Surface::Plane>::Desc>
auto gaussianMixtureMeanCov(const components_t components,
projector_t &&projector = projector_t{},
Expand Down Expand Up @@ -212,7 +211,7 @@ auto gaussianMixtureMeanCov(const components_t components,
/// like a std::tuple< double, BoundVector, BoundMatrix >
///
/// @return parameters and covariance as std::tuple< BoundVector, BoundMatrix >
template <typename mixture_t, typename projector_t = Acts::Identity>
template <typename mixture_t, typename projector_t = std::identity>
auto mergeGaussianMixture(const mixture_t &mixture, const Surface &surface,
ComponentMergeMethod method,
projector_t &&projector = projector_t{}) {
Expand Down
36 changes: 0 additions & 36 deletions Core/include/Acts/Utilities/Identity.hpp

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include "Acts/Surfaces/Surface.hpp"
#include "Acts/Surfaces/SurfaceBounds.hpp"
#include "Acts/TrackFitting/detail/GsfComponentMerging.hpp"
#include "Acts/Utilities/Identity.hpp"
#include "Acts/Utilities/Intersection.hpp"
#include "Acts/Utilities/Result.hpp"
#include "Acts/Utilities/detail/periodic.hpp"
Expand Down Expand Up @@ -216,7 +215,7 @@ using LocPosArray = std::array<std::pair<double, double>, 4>;
template <typename angle_description_t>
void test_surface(const Surface &surface, const angle_description_t &desc,
const LocPosArray &loc_pos, double expectedError) {
const auto proj = Identity{};
const auto proj = std::identity{};

for (auto phi : {-175_degree, 0_degree, 175_degree}) {
for (auto theta : {5_degree, 90_degree, 175_degree}) {
Expand Down Expand Up @@ -271,7 +270,7 @@ BOOST_AUTO_TEST_CASE(test_with_data) {
const auto boundCov_data = boundCov(samples, mean_data);

const auto [mean_test, boundCov_test] =
detail::gaussianMixtureMeanCov(cmps, Identity{}, std::tuple<>{});
detail::gaussianMixtureMeanCov(cmps, std::identity{}, std::tuple<>{});

CHECK_CLOSE_MATRIX(mean_data, mean_test, 1.e-1);
CHECK_CLOSE_MATRIX(boundCov_data, boundCov_test, 1.e-1);
Expand Down Expand Up @@ -302,7 +301,7 @@ BOOST_AUTO_TEST_CASE(test_with_data_circular) {
using detail::CyclicAngle;
const auto d = std::tuple<CyclicAngle<eBoundLoc0>, CyclicAngle<eBoundLoc1>>{};
const auto [mean_test, boundCov_test] =
detail::gaussianMixtureMeanCov(cmps, Identity{}, d);
detail::gaussianMixtureMeanCov(cmps, std::identity{}, d);

BOOST_CHECK(std::abs(detail::difference_periodic(mean_data[0], mean_test[0],
2 * M_PI)) < 1.e-1);
Expand Down
Loading