mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-26 05:05:30 -04:00
Allow OpenMC to compile against fmt v9
This commit is contained in:
parent
d3c149b14c
commit
23646c3c7c
1 changed files with 11 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue