Merge pull request #2136 from andrsd/fmt-v9

Allow OpenMC to compile against fmt v9
This commit is contained in:
Paul Romano 2022-07-26 09:57:43 -05:00 committed by GitHub
commit a4d6de1d7b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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