Skip to content

Commit bb54fe6

Browse files
author
beryll1um
committed
fix(points): point formatters fixed
1 parent bcb5be3 commit bb54fe6

File tree

3 files changed

+27
-18
lines changed

3 files changed

+27
-18
lines changed

include/unified/core/math/point2.hpp

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,14 @@ typedef Point<double, 2> Point2d;
115115

116116
UNIFIED_END_NAMESPACE
117117

118-
template <class _type> struct fmt::formatter<UNIFIED_NAMESPACE::Point<_type, 2>> : fmt::formatter<std::string> {
119-
template <class FormatContext>
120-
auto format(const UNIFIED_NAMESPACE::Point<_type, 2> &point, FormatContext &ctx) {
121-
return formatter<std::string>::format(fmt::format("{{ {}, {} }}", point.x, point.y), ctx);
122-
}
123-
};
118+
namespace fmt
119+
{
120+
template <class _type> struct formatter<UNIFIED_NAMESPACE::Point<_type, 2>> : formatter<std::string> {
121+
template <class FormatContext>
122+
auto format(const UNIFIED_NAMESPACE::Point<_type, 2> &point, FormatContext &ctx) {
123+
return formatter<std::string>::format(fmt::format("{{ {}, {} }}", point.x, point.y), ctx);
124+
}
125+
};
126+
}
124127

125128
#endif

include/unified/core/math/point3.hpp

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,14 @@ typedef Point<double, 3> Point3d;
117117

118118
UNIFIED_END_NAMESPACE
119119

120-
template <class _type> struct fmt::formatter<UNIFIED_NAMESPACE::Point<_type, 3>> : fmt::formatter<std::string> {
121-
template <class FormatContext>
122-
auto format(const UNIFIED_NAMESPACE::Point<_type, 3> &point, FormatContext &ctx) {
123-
return formatter<std::string>::format(fmt::format("{{ {}, {}, {} }}", point.x, point.y, point.z), ctx);
124-
}
125-
};
120+
namespace fmt
121+
{
122+
template <class _type> struct formatter<UNIFIED_NAMESPACE::Point<_type, 3>> : formatter<std::string> {
123+
template <class FormatContext>
124+
auto format(const UNIFIED_NAMESPACE::Point<_type, 3> &point, FormatContext &ctx) {
125+
return formatter<std::string>::format(fmt::format("{{ {}, {}, {} }}", point.x, point.y, point.z), ctx);
126+
}
127+
};
128+
}
126129

127130
#endif

include/unified/core/math/point4.hpp

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,14 @@ typedef Point<double, 4> Point4d;
119119

120120
UNIFIED_END_NAMESPACE
121121

122-
template <class _type> struct fmt::formatter<UNIFIED_NAMESPACE::Point<_type, 4>> : fmt::formatter<std::string> {
123-
template <class FormatContext>
124-
auto format(const UNIFIED_NAMESPACE::Point<_type, 4> &point, FormatContext &ctx) {
125-
return formatter<std::string>::format(fmt::format("{{ {}, {}, {}, {} }}", point.x, point.y, point.z, point.w), ctx);
126-
}
127-
};
122+
namespace fmt
123+
{
124+
template <class _type> struct formatter<UNIFIED_NAMESPACE::Point<_type, 4>> : formatter<std::string> {
125+
template <class FormatContext>
126+
auto format(const UNIFIED_NAMESPACE::Point<_type, 4> &point, FormatContext &ctx) {
127+
return formatter<std::string>::format(fmt::format("{{ {}, {}, {}, {} }}", point.x, point.y, point.z, point.w), ctx);
128+
}
129+
};
130+
}
128131

129132
#endif

0 commit comments

Comments
 (0)