From f3969daa4a8cea401526cd0ad4813c53e23d10a2 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Tue, 18 Apr 2023 22:50:14 -0500 Subject: [PATCH] Ensure compilation with gcc 5 works (refs #2474) --- include/openmc/mesh.h | 4 ++-- include/openmc/position.h | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/include/openmc/mesh.h b/include/openmc/mesh.h index 4fdb2eb4ab..cef4e05184 100644 --- a/include/openmc/mesh.h +++ b/include/openmc/mesh.h @@ -412,7 +412,7 @@ private: bool full_phi_ {false}; - constexpr inline int sanitize_angular_index(int idx, bool full, int N) const + inline int sanitize_angular_index(int idx, bool full, int N) const { if ((idx > 0) and (idx <= N)) { return idx; @@ -467,7 +467,7 @@ private: bool full_theta_ {false}; bool full_phi_ {false}; - constexpr inline int sanitize_angular_index(int idx, bool full, int N) const + inline int sanitize_angular_index(int idx, bool full, int N) const { if ((idx > 0) and (idx <= N)) { return idx; diff --git a/include/openmc/position.h b/include/openmc/position.h index 0200cda3b7..11ea376479 100644 --- a/include/openmc/position.h +++ b/include/openmc/position.h @@ -216,14 +216,18 @@ using Direction = Position; } // namespace openmc +namespace fmt { + template<> -struct fmt::formatter : formatter { +struct formatter : formatter { template auto format(const openmc::Position& pos, FormatContext& ctx) { - return fmt::formatter::format( + return formatter::format( fmt::format("({}, {}, {})", pos.x, pos.y, pos.z), ctx); } }; +} // namespace fmt + #endif // OPENMC_POSITION_H