Allow OpenMC to compile against fmt v9

This commit is contained in:
David Andrs 2022-07-23 08:56:12 -06:00
parent d3c149b14c
commit 23646c3c7c
No known key found for this signature in database
GPG key ID: AD4ED78D935C413C

View file

@ -5,6 +5,7 @@
#include <iostream>
#include <stdexcept> // for out_of_range
#include "fmt/format.h"
#include "openmc/array.h"
#include "openmc/vector.h"
@ -210,4 +211,14 @@ using Direction = Position;
} // namespace openmc
template<>
struct fmt::formatter<openmc::Position> : formatter<std::string> {
template<typename FormatContext>
auto format(const openmc::Position& pos, FormatContext& ctx)
{
return fmt::formatter<std::string>::format(
fmt::format("({}, {}, {})", pos.x, pos.y, pos.z), ctx);
}
};
#endif // OPENMC_POSITION_H