diff --git a/include/fmt/format.h b/include/fmt/format.h index dd04a79e..6caa4f9d 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -4097,13 +4097,10 @@ class format_int { template struct formatter::value>> - : private formatter, Char> { - using base = formatter, Char>; - using base::parse; - using base::set_debug_format; - + : formatter, Char> { template auto format(const T& value, FormatContext& ctx) const -> decltype(ctx.out()) { + using base = formatter, Char>; return base::format(format_as(value), ctx); } }; diff --git a/test/ranges-test.cc b/test/ranges-test.cc index ba5c464d..c67eed9f 100644 --- a/test/ranges-test.cc +++ b/test/ranges-test.cc @@ -528,3 +528,16 @@ TEST(ranges_test, container_adaptor) { EXPECT_EQ(fmt::format("{}", m), "[1, 2]"); } } + +struct tieable { + int a = 3; + double b = 0.42; +}; + +auto format_as(const tieable& t) -> std::tuple { + return std::tie(t.a, t.b); +} + +TEST(ranges_test, format_as_tie) { + EXPECT_EQ(fmt::format("{}", tieable()), "(3, 0.42)"); +}