mirror of
https://github.com/ceph/ceph
synced 2024-12-29 15:03:33 +00:00
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<rgw_obj_key> is defined so the tree can compile with fmt v9. Signed-off-by: Kefu Chai <tchaikov@gmail.com>
This commit is contained in:
parent
b1382d0a23
commit
c7e3e95277
@ -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<rgw_obj_key> : fmt::formatter<std::string_view> {
|
||||
template <typename FormatContext>
|
||||
auto format(const rgw_obj_key& key, FormatContext& ctx) const {
|
||||
return formatter<std::string_view>::format(key.to_str(), ctx);
|
||||
}
|
||||
};
|
||||
|
||||
struct rgw_raw_obj {
|
||||
rgw_pool pool;
|
||||
std::string oid;
|
||||
|
Loading…
Reference in New Issue
Block a user