diff --git a/module/string.cppm b/module/string.cppm index 923f3e4..f2fd147 100644 --- a/module/string.cppm +++ b/module/string.cppm @@ -700,3 +700,12 @@ using string = basic_string>; } } + +export template +struct std::formatter, char> : std::formatter +{ + auto format(const kqm::basic_string& s, auto&& ctx) const + { + return std::formatter::format(s.all(), ctx); + } +}; diff --git a/module/view.cppm b/module/view.cppm index 45e55de..59a2eeb 100644 --- a/module/view.cppm +++ b/module/view.cppm @@ -213,3 +213,12 @@ public: }; } + +export template <> +struct std::formatter : std::formatter +{ + auto format(kqm::string_view s, auto&& ctx) const + { + return std::formatter::format(s.to_std_string_view(), ctx); + } +};