diff --git a/src/algorithms/tracking/ActsGeometryProvider.cc b/src/algorithms/tracking/ActsGeometryProvider.cc index 32cb4a5a1e..7809980baa 100644 --- a/src/algorithms/tracking/ActsGeometryProvider.cc +++ b/src/algorithms/tracking/ActsGeometryProvider.cc @@ -19,10 +19,22 @@ #include #include - #include "extensions/spdlog/SpdlogToActs.h" #include "extensions/spdlog/SpdlogFormatters.h" +// Formatter for Eigen matrices +#if FMT_VERSION >= 90000 +#include +template +struct fmt::formatter< + T, + std::enable_if_t< + std::is_base_of_v, T>, + char + > +> : fmt::ostream_formatter {}; +#endif // FMT_VERSION >= 90000 + void draw_surfaces(std::shared_ptr trk_geo, const Acts::GeometryContext geo_ctx, const std::string &fname) { using namespace Acts; diff --git a/src/algorithms/tracking/TrackProjector.cc b/src/algorithms/tracking/TrackProjector.cc index 6935ebd425..18af5e3c58 100644 --- a/src/algorithms/tracking/TrackProjector.cc +++ b/src/algorithms/tracking/TrackProjector.cc @@ -37,6 +37,10 @@ #include +#if FMT_VERSION >= 90000 +template<> struct fmt::formatter : fmt::ostream_formatter {}; +#endif // FMT_VERSION >= 90000 + namespace eicrecon { void diff --git a/src/extensions/spdlog/SpdlogFormatters.h b/src/extensions/spdlog/SpdlogFormatters.h index f0a8c3466f..66f3de5dc4 100644 --- a/src/extensions/spdlog/SpdlogFormatters.h +++ b/src/extensions/spdlog/SpdlogFormatters.h @@ -11,42 +11,8 @@ #include #include -#include - #if FMT_VERSION >= 90000 -/* - -template -struct has_output_operator : std::false_type {}; - -template -struct has_output_operator())>> : std::true_type {}; - -template -struct fmt::formatter< - T, - std::enable_if_t< - !fmt::has_formatter::value && - has_output_operator::value, - Char - > -> : fmt::ostream_formatter {}; - -*/ - -// handle Eigen CRTP -template -struct fmt::formatter< - T, - std::enable_if_t< - std::is_base_of_v, T>, - char - > -> : fmt::ostream_formatter {}; - -template<> struct fmt::formatter : fmt::ostream_formatter {}; - template<> struct fmt::formatter : fmt::ostream_formatter {}; template<> struct fmt::formatter : fmt::ostream_formatter {}; template<> struct fmt::formatter : fmt::ostream_formatter {};