为 kqm::string 和 kqm::string_view 添加格式化支持
This commit is contained in:
parent
913dc6548a
commit
f47d5dd8f3
@ -700,3 +700,12 @@ using string = basic_string<std::pmr::polymorphic_allocator<std::byte>>;
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export template <typename Allocator>
|
||||||
|
struct std::formatter<kqm::basic_string<Allocator>, char> : std::formatter<kqm::string_view, char>
|
||||||
|
{
|
||||||
|
auto format(const kqm::basic_string<Allocator>& s, auto&& ctx) const
|
||||||
|
{
|
||||||
|
return std::formatter<kqm::string_view, char>::format(s.all(), ctx);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
@ -213,3 +213,12 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export template <>
|
||||||
|
struct std::formatter<kqm::string_view, char> : std::formatter<std::string_view, char>
|
||||||
|
{
|
||||||
|
auto format(kqm::string_view s, auto&& ctx) const
|
||||||
|
{
|
||||||
|
return std::formatter<std::string_view, char>::format(s.to_std_string_view(), ctx);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user