diff --git a/include/openmc/output.h b/include/openmc/output.h index 549d2ae32ba..940ea78ceb9 100644 --- a/include/openmc/output.h +++ b/include/openmc/output.h @@ -76,10 +76,14 @@ struct formatter> { } template - auto format(const std::array& arr, FormatContext& ctx) const +#if FMT_VERSION >= 110000 // Version 11.0.0 and above + auto format(const std::array& arr, FormatContext& ctx) const { +#else // For versions below 11.0.0 + auto format(const std::array& arr, FormatContext& ctx) { +#endif return format_to(ctx.out(), "({}, {})", arr[0], arr[1]); - } -}; +} +}; // namespace fmt } // namespace fmt diff --git a/include/openmc/position.h b/include/openmc/position.h index e6939dc0e46..dc60ab35a04 100644 --- a/include/openmc/position.h +++ b/include/openmc/position.h @@ -221,12 +221,16 @@ namespace fmt { template<> struct formatter : formatter { template - auto format(const openmc::Position& pos, FormatContext& ctx) const +#if FMT_VERSION >= 110000 // Version 11.0.0 and above + auto format(const openmc::Position& pos, FormatContext& ctx) const { +#else // For versions below 11.0.0 + auto format(const openmc::Position& pos, FormatContext& ctx) { +#endif return formatter::format( fmt::format("({}, {}, {})", pos.x, pos.y, pos.z), ctx); - } -}; +} +}; // namespace fmt } // namespace fmt