commit 51b0651ed5d92204a2374309c0f318788212b8b2 Author: Daniel Swanson Date: Thu Jun 10 12:39:44 2021 -0500 add << UChar for newer g++ and switch << back to std::ostream diff --git a/lttoolbox/ustring.h b/lttoolbox/ustring.h index 459fcfa..fd7ea13 100644 --- a/lttoolbox/ustring.h +++ b/lttoolbox/ustring.h @@ -40,8 +40,15 @@ UString to_ustring(const char* str); // append UTF-16 string to UTF-32 vector of symbols void ustring_to_vec32(const UString& str, std::vector& vec); -inline std::basic_ostream& -operator<<(std::basic_ostream& ostr, const UString& str) +inline std::ostream& +operator<<(std::ostream& ostr, UChar c) +{ + ostr << std::hex << static_cast(c); + return ostr; +} + +inline std::ostream& +operator<<(std::ostream& ostr, const UString& str) { std::string res; utf8::utf16to8(str.begin(), str.end(), std::back_inserter(res));