Skip to content

Commit

Permalink
#2216: Fix compile errors with newer version of fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobDomagala committed Apr 30, 2024
1 parent c2f090e commit fae07f8
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 17 deletions.
1 change: 1 addition & 0 deletions src/vt/collective/reduce/reduce_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
#include "vt/collective/reduce/reduce_scope.h"
#include "vt/collective/tree/tree.h"

#include <memory>
namespace vt { namespace collective { namespace reduce {

struct Reduce;
Expand Down
2 changes: 1 addition & 1 deletion src/vt/elm/elm_id.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ struct formatter<::vt::elm::ElementIDStruct> {
/// Formats the epoch using the parsed format specification (presentation)
/// stored in this formatter.
template <typename FormatContext>
auto format(::vt::elm::ElementIDStruct const& e, FormatContext& ctx) {
auto format(::vt::elm::ElementIDStruct const& e, FormatContext& ctx) const {
std::string id_format =
presentation == 'b' ? "{:b}" : (presentation == 'd' ? "{:d}" : "{:x}");
auto fmt_str = "(" + id_format + ",{},{},{})";
Expand Down
2 changes: 1 addition & 1 deletion src/vt/epoch/epoch_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ struct formatter<::vt::epoch::EpochType> {
/// Formats the epoch using the parsed format specification (presentation)
/// stored in this formatter.
template <typename FormatContext>
auto format(::vt::epoch::EpochType const& e, FormatContext& ctx) {
auto format(::vt::epoch::EpochType const& e, FormatContext& ctx) const {
return format_to(
ctx.out(),
presentation == 'b' ? "{:b}" : (presentation == 'd' ? "{:d}" : "{:x}"),
Expand Down
2 changes: 1 addition & 1 deletion src/vt/rdma/rdma_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ VT_FMT_NAMESPACE_BEGIN
template <>
struct formatter<::vt::rdma::Type> : formatter<std::string_view> {
template <typename FormatContext>
auto format(::vt::rdma::Type t, FormatContext& ctx) {
auto format(::vt::rdma::Type t, FormatContext& ctx) const {
std::string_view name = "Unknown";
switch (t) {
case ::vt::rdma::Type::Get:
Expand Down
2 changes: 1 addition & 1 deletion src/vt/termination/interval/interval.h
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ struct formatter<::vt::term::interval::Interval<DomainT, sentinel>>
template <typename FormatContext>
auto format(
const ::vt::term::interval::Interval<DomainT, sentinel>& interval,
FormatContext& ctx) {
FormatContext& ctx) const {
return format_to(
ctx.out(), "Interval[{}, {}]", interval.lower(), interval.upper());
}
Expand Down
19 changes: 9 additions & 10 deletions src/vt/timing/timing.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,20 +65,19 @@ TimeType getCurrentTime();

VT_FMT_NAMESPACE_BEGIN

template <typename FormatContext>
auto format(::vt::TimeTypeWrapper const& t, FormatContext& ctx) {
return fmt::format_to(
ctx.out(), "{}",
to_engineering_string(t.seconds(), 5, eng_exponential, "s")
);
template<>
struct formatter<::vt::TimeTypeWrapper> {
template<typename ParseContext>
constexpr auto parse(ParseContext& ctx) {
return ctx.begin();
}
};

template <typename FormatContext>
auto format(::vt::TimeTypeWrapper const& t, FormatContext& ctx) {
template<typename FormatContext>
auto format(::vt::TimeTypeWrapper const& t, FormatContext& ctx) const {
return fmt::format_to(
ctx.out(), "{}",
to_engineering_string(t.seconds(), 3, eng_exponential, "s"));
to_engineering_string(t.seconds(), 5, eng_exponential, "s")
);
}
};

Expand Down
2 changes: 1 addition & 1 deletion src/vt/topos/index/dense/dense_array.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ struct formatter<::vt::index::DenseIndexArray<IndexType, ndim>>
auto format(
const ::vt::index::DenseIndexArray<IndexType, ndim>& idx,
FormatContext& ctx
) {
) const {
return formatter<std::string>::format(idx.toString(), ctx);
}
};
Expand Down
2 changes: 1 addition & 1 deletion src/vt/vrt/collection/balance/temperedlb/criterion.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ template <>
struct formatter<::vt::vrt::collection::lb::CriterionEnum>
: formatter<std::string_view> {
template <typename FormatContext>
auto format(::vt::vrt::collection::lb::CriterionEnum c, FormatContext& ctx) {
auto format(::vt::vrt::collection::lb::CriterionEnum c, FormatContext& ctx) const {
std::string_view name = "Unknown";
switch (c) {
case ::vt::vrt::collection::lb::CriterionEnum::Grapevine:
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/lb/test_lbargs_enum_conv.nompi.cc
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ VT_FMT_NAMESPACE_BEGIN
template <>
struct formatter<::vt::tests::unit::DummyEnum> : formatter<std::string_view> {
template <typename FormatContext>
auto format(::vt::tests::unit::DummyEnum c, FormatContext& ctx) {
auto format(::vt::tests::unit::DummyEnum c, FormatContext& ctx) const {
std::string_view name = "Unknown";
switch (c) {
case ::vt::tests::unit::DummyEnum::One:
Expand Down

0 comments on commit fae07f8

Please sign in to comment.