diff --git a/cql3/ut_name.hh b/cql3/ut_name.hh index f73f612104..37860fabd3 100644 --- a/cql3/ut_name.hh +++ b/cql3/ut_name.hh @@ -12,6 +12,7 @@ #include #include +#include #include "seastarx.hh" #include "bytes.hh" @@ -38,10 +39,13 @@ public: sstring get_string_type_name() const; sstring to_cql_string() const; - - friend std::ostream& operator<<(std::ostream& os, const ut_name& n) { - return os << n.to_cql_string(); - } }; } + +template <> struct fmt::formatter { + constexpr auto parse(format_parse_context& ctx) { return ctx.begin(); } + auto format(const cql3::ut_name& n, fmt::format_context& ctx) const { + return fmt::format_to(ctx.out(), "{}", n.to_cql_string()); + } +};