rsx: Fix printing of expected values

This commit is contained in:
kd-11 2023-01-07 22:51:02 +03:00 committed by kd-11
parent c7fed20f3c
commit 439bdde849
5 changed files with 66 additions and 3 deletions

View file

@ -237,6 +237,29 @@ struct fmt_class_string<wchar_t*, void> : fmt_class_string<const wchar_t*>
{
};
namespace fmt
{
template <typename T>
concept StringConvertible = requires (T & t)
{
{ t.to_string() } -> std::convertible_to<std::string>;
};
}
template <fmt::StringConvertible T>
struct fmt_class_string<T, void>
{
static FORCE_INLINE SAFE_BUFFERS(const T&) get_object(u64 arg)
{
return *reinterpret_cast<const T*>(static_cast<uptr>(arg));
}
static void format(std::string& out, u64 arg)
{
out += get_object(arg).to_string();
}
};
namespace fmt
{
// Both uchar and std::byte are allowed