mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-26 13:15:39 -04:00
Update fmt Formatters for Compatibility with Versions below 11 (#3172)
This commit is contained in:
parent
c19b9b1beb
commit
82a6f9e40b
2 changed files with 14 additions and 6 deletions
|
|
@ -76,10 +76,14 @@ struct formatter<std::array<T, 2>> {
|
|||
}
|
||||
|
||||
template<typename FormatContext>
|
||||
auto format(const std::array<T, 2>& arr, FormatContext& ctx) const
|
||||
#if FMT_VERSION >= 110000 // Version 11.0.0 and above
|
||||
auto format(const std::array<T, 2>& arr, FormatContext& ctx) const {
|
||||
#else // For versions below 11.0.0
|
||||
auto format(const std::array<T, 2>& arr, FormatContext& ctx)
|
||||
{
|
||||
#endif
|
||||
return format_to(ctx.out(), "({}, {})", arr[0], arr[1]);
|
||||
}
|
||||
};
|
||||
}
|
||||
}; // namespace fmt
|
||||
|
||||
} // namespace fmt
|
||||
|
|
|
|||
|
|
@ -221,12 +221,16 @@ namespace fmt {
|
|||
template<>
|
||||
struct formatter<openmc::Position> : formatter<std::string> {
|
||||
template<typename FormatContext>
|
||||
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<std::string>::format(
|
||||
fmt::format("({}, {}, {})", pos.x, pos.y, pos.z), ctx);
|
||||
}
|
||||
};
|
||||
}
|
||||
}; // namespace fmt
|
||||
|
||||
} // namespace fmt
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue