Skip to content

Commit

Permalink
Check git actions build
Browse files Browse the repository at this point in the history
  • Loading branch information
chronoxor committed Mar 8, 2024
1 parent 17c3343 commit 34ec877
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
16 changes: 8 additions & 8 deletions examples/format.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ class Date
template <>
struct fmt::formatter<Date>
{
constexpr auto parse(format_parse_context& ctx) -> decltype(ctx.begin()) { return ctx.begin(); }
constexpr auto parse(format_parse_context& ctx) -> decltype(ctx.begin()) { return ctx.begin(); }

template <typename FormatContext>
auto format(const Date& date, FormatContext& ctx) -> decltype(ctx.out())
auto format(const Date& date, format_context& ctx) const -> decltype(ctx.out())
{
return fmt::format_to(ctx.out(), "{}-{}-{}", date.year(), date.month(), date.day());
fmt::format_to(ctx.out(), "{}-{}-{}", date.year(), date.month(), date.day());
return ctx.out();
}
};

Expand Down Expand Up @@ -67,12 +67,12 @@ class DateTime
template <>
struct fmt::formatter<DateTime>
{
constexpr auto parse(format_parse_context& ctx) -> decltype(ctx.begin()) { return ctx.begin(); }
constexpr auto parse(format_parse_context& ctx) -> decltype(ctx.begin()) { return ctx.begin(); }

template <typename FormatContext>
auto format(const DateTime& datetime, FormatContext& ctx) -> decltype(ctx.out())
auto format(const DateTime& datetime, format_context& ctx) const -> decltype(ctx.out())
{
return fmt::format_to(ctx.out(), "{} {}:{}:{}", datetime.date(), datetime.hours(), datetime.minutes(), datetime.seconds());
fmt::format_to(ctx.out(), "{} {}:{}:{}", datetime.date(), datetime.hours(), datetime.minutes(), datetime.seconds());
return ctx.out();
}
};

Expand Down
16 changes: 8 additions & 8 deletions tests/test_record_format.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ class Date
template <>
struct fmt::formatter<Date>
{
constexpr auto parse(format_parse_context& ctx) -> decltype(ctx.begin()) { return ctx.begin(); }
constexpr auto parse(format_parse_context& ctx) -> decltype(ctx.begin()) { return ctx.begin(); }

template <typename FormatContext>
auto format(const Date& date, FormatContext& ctx) -> decltype(ctx.out())
auto format(const Date& date, format_context& ctx) const -> decltype(ctx.out())
{
return fmt::format_to(ctx.out(), "{}-{}-{}", date.year(), date.month(), date.day());
fmt::format_to(ctx.out(), "{}-{}-{}", date.year(), date.month(), date.day());
return ctx.out();
}
};

Expand Down Expand Up @@ -75,12 +75,12 @@ class DateTime
template <>
struct fmt::formatter<DateTime>
{
constexpr auto parse(format_parse_context& ctx) -> decltype(ctx.begin()) { return ctx.begin(); }
constexpr auto parse(format_parse_context& ctx) -> decltype(ctx.begin()) { return ctx.begin(); }

template <typename FormatContext>
auto format(const DateTime& datetime, FormatContext& ctx) -> decltype(ctx.out())
auto format(const DateTime& datetime, format_context& ctx) const -> decltype(ctx.out())
{
return fmt::format_to(ctx.out(), "{} {}:{}:{}", datetime.date(), datetime.hours(), datetime.minutes(), datetime.seconds());
fmt::format_to(ctx.out(), "{} {}:{}:{}", datetime.date(), datetime.hours(), datetime.minutes(), datetime.seconds());
return ctx.out();
}
};

Expand Down

0 comments on commit 34ec877

Please sign in to comment.