Skip to content

Commit

Permalink
Workaround for gcc 6 (fmtlib#3810)
Browse files Browse the repository at this point in the history
Signed-off-by: Vladislav Shchapov <[email protected]>
  • Loading branch information
phprus authored and happymonkey1 committed Apr 6, 2024
1 parent c4bae0c commit 53b4db6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion doc/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,8 @@ For example::
struct fmt::formatter<point> : nested_formatter<double> {
auto format(point p, format_context& ctx) const {
return write_padded(ctx, [=](auto out) {
return format_to(out, "({}, {})", nested(p.x), nested(p.y));
return format_to(out, "({}, {})", this->nested(p.x),
this->nested(p.y));
});
}
};
Expand Down
3 changes: 2 additions & 1 deletion test/format-test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1765,7 +1765,8 @@ FMT_BEGIN_NAMESPACE
template <> struct formatter<point> : nested_formatter<double> {
auto format(point p, format_context& ctx) const -> decltype(ctx.out()) {
return write_padded(ctx, [this, p](auto out) -> decltype(out) {
return fmt::format_to(out, "({}, {})", nested(p.x), nested(p.y));
return fmt::format_to(out, "({}, {})", this->nested(p.x),
this->nested(p.y));
});
}
};
Expand Down

0 comments on commit 53b4db6

Please sign in to comment.