From 5dfa9088355740402f5aed593eafa02acf746e85 Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Sat, 10 Jul 2021 21:11:52 +0300 Subject: [PATCH] fmt: add support for std::u8string --- Utilities/StrFmt.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/Utilities/StrFmt.cpp b/Utilities/StrFmt.cpp index 082ae05339..8297e7ef38 100644 --- a/Utilities/StrFmt.cpp +++ b/Utilities/StrFmt.cpp @@ -152,6 +152,27 @@ void fmt_class_string>::format(std::string& out, u64 arg) out.append(obj.cbegin(), obj.cend()); } +template <> +void fmt_class_string::format(std::string& out, u64 arg) +{ + const std::u8string& obj = get_object(arg); + out.append(obj.cbegin(), obj.cend()); +} + +template <> +void fmt_class_string::format(std::string& out, u64 arg) +{ + const std::u8string_view& obj = get_object(arg); + out.append(obj.cbegin(), obj.cend()); +} + +template <> +void fmt_class_string>::format(std::string& out, u64 arg) +{ + const std::vector& obj = get_object(arg); + out.append(obj.cbegin(), obj.cend()); +} + template <> void fmt_class_string::format(std::string& out, u64 arg) {