Skip to content

Commit d7dfd85

Browse files
JacobDomagalacwschilly
authored andcommitted
#2216: Fix compile errors when using newer fmt version
1 parent e986162 commit d7dfd85

File tree

4 files changed

+18
-12
lines changed

4 files changed

+18
-12
lines changed

src/vt/rdma/rdma_common.h

+5-2
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,9 @@ static constexpr ByteType rdma_default_byte_size = sizeof(char);
120120
VT_FMT_NAMESPACE_BEGIN
121121

122122
template <>
123-
struct formatter<::vt::rdma::Type> : formatter<std::string_view> {
123+
struct formatter<::vt::rdma::Type> {
124+
constexpr auto parse(fmt::format_parse_context& ctx) { return ctx.begin(); }
125+
124126
template <typename FormatContext>
125127
auto format(::vt::rdma::Type t, FormatContext& ctx) const {
126128
std::string_view name = "Unknown";
@@ -141,7 +143,8 @@ struct formatter<::vt::rdma::Type> : formatter<std::string_view> {
141143
name = fmt::format(
142144
"{}", static_cast<std::underlying_type_t<::vt::rdma::Type>>(t));
143145
}
144-
return formatter<std::string_view>::format(name, ctx);
146+
147+
return fmt::format_to(ctx.out(), name);
145148
}
146149
};
147150

src/vt/topos/index/dense/dense_array.h

+5-5
Original file line numberDiff line numberDiff line change
@@ -160,14 +160,14 @@ static_assert(
160160
VT_FMT_NAMESPACE_BEGIN
161161

162162
template <typename IndexType, ::vt::index::NumDimensionsType ndim>
163-
struct formatter<::vt::index::DenseIndexArray<IndexType, ndim>>
164-
: formatter<std::string> {
163+
struct formatter<::vt::index::DenseIndexArray<IndexType, ndim>> {
164+
constexpr auto parse(fmt::format_parse_context& ctx) { return ctx.begin(); }
165+
165166
template <typename FormatContext>
166167
auto format(
167168
const ::vt::index::DenseIndexArray<IndexType, ndim>& idx,
168-
FormatContext& ctx
169-
) const {
170-
return formatter<std::string>::format(idx.toString(), ctx);
169+
FormatContext& ctx) const {
170+
return fmt::format_to(ctx.out(), idx.toString());
171171
}
172172
};
173173

src/vt/vrt/collection/balance/temperedlb/criterion.h

+4-3
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,9 @@ struct Criterion {
9696
VT_FMT_NAMESPACE_BEGIN
9797

9898
template <>
99-
struct formatter<::vt::vrt::collection::lb::CriterionEnum>
100-
: formatter<std::string_view> {
99+
struct formatter<::vt::vrt::collection::lb::CriterionEnum> {
100+
constexpr auto parse(fmt::format_parse_context& ctx) { return ctx.begin(); }
101+
101102
template <typename FormatContext>
102103
auto format(::vt::vrt::collection::lb::CriterionEnum c, FormatContext& ctx) const {
103104
std::string_view name = "Unknown";
@@ -109,7 +110,7 @@ struct formatter<::vt::vrt::collection::lb::CriterionEnum>
109110
name = "ModifiedGrapevine";
110111
break;
111112
}
112-
return formatter<string_view>::format(name, ctx);
113+
return fmt::format_to(ctx.out(), name);
113114
}
114115
};
115116

tests/unit/lb/test_lbargs_enum_conv.nompi.cc

+4-2
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,9 @@ TEST_F(TestLBArgsEnumConverter, test_enum_converter_config) {
150150

151151
VT_FMT_NAMESPACE_BEGIN
152152
template <>
153-
struct formatter<::vt::tests::unit::DummyEnum> : formatter<std::string_view> {
153+
struct formatter<::vt::tests::unit::DummyEnum> {
154+
constexpr auto parse(fmt::format_parse_context& ctx) { return ctx.begin(); }
155+
154156
template <typename FormatContext>
155157
auto format(::vt::tests::unit::DummyEnum c, FormatContext& ctx) const {
156158
std::string_view name = "Unknown";
@@ -165,7 +167,7 @@ VT_FMT_NAMESPACE_BEGIN
165167
name = "Three";
166168
break;
167169
}
168-
return formatter<string_view>::format(name, ctx);
170+
return fmt::format_to(ctx.out(), name);
169171
}
170172
};
171173
VT_FMT_NAMESPACE_END

0 commit comments

Comments
 (0)