From c7e3e95277c69f94574928115f4cb7bf3608a79f Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Fri, 2 Dec 2022 17:23:23 +0800 Subject: [PATCH] rgw: specialize fmt::formatter<> for rgw_obj_key since fmt v9, fmt::formatter<> is not specialized for the types with operator<<(ostream&, ...) anymore. so we need to specialize it manually. in this change, fmt::formatter is defined so the tree can compile with fmt v9. Signed-off-by: Kefu Chai --- src/rgw/rgw_obj_types.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/rgw/rgw_obj_types.h b/src/rgw/rgw_obj_types.h index 781150b8becda..c90d450793c7b 100644 --- a/src/rgw/rgw_obj_types.h +++ b/src/rgw/rgw_obj_types.h @@ -397,6 +397,13 @@ inline std::ostream& operator<<(std::ostream& out, const rgw_obj_key &o) { return out << o.to_str(); } +template<> struct fmt::formatter : fmt::formatter { + template + auto format(const rgw_obj_key& key, FormatContext& ctx) const { + return formatter::format(key.to_str(), ctx); + } +}; + struct rgw_raw_obj { rgw_pool pool; std::string oid; -- 2.39.5