mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-29 19:21:01 +00:00
this is a part of a series to migrating from `operator<<(ostream&, ..)` based formatting to fmtlib based formatting. the goal here is to enable fmtlib to print `api::table_info` without the help of `operator<<`. but the corresponding `operator<<()` is preserved in this change, as we still have lots of callers relying on this << operator instorage_service.cc where std::vector<table_info> is formatted using operator<<(ostream&, const Range&) defined in to_string.hh. we could have used fmt/ranges.h to print the std::vector<table_info>. but the combination of operator<<(ostream&, const Range&) and FMT_DEPRECATED_OSTREAM renders this impossible. because unlike the builtin range formatter specializations, the fallback formatter synthesized from the operator<< does not have brackets defined for the range printer. the brackets are used as the left and right marks of the range, for instance, the array-alike containers are printed like [1,2,3], while the tuple-alike containers are printed like (1,2,3). once we are allowed to remove FMT_DEPRECATED_OSTREAM, we should be able to use the builtin range formatter, and remove the operator<< for api::table_info by then. Refs #13245 Signed-off-by: Kefu Chai <kefu.chai@scylladb.com> Closes #13975