From: Kefu Chai Date: Fri, 2 Dec 2022 09:23:23 +0000 (+0800) Subject: rgw: specialize fmt::formatter<> for rgw_obj_key X-Git-Tag: v18.1.0~662^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c7e3e95277c69f94574928115f4cb7bf3608a79f;p=ceph.git 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 --- diff --git a/src/rgw/rgw_obj_types.h b/src/rgw/rgw_obj_types.h index 781150b8becd..c90d450793c7 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;