From b556adb897f18e500bb4d8f89c81c0f0764f1ff2 Mon Sep 17 00:00:00 2001 From: "B. Stack" Date: Wed, 7 Sep 2022 14:55:03 -0400 Subject: add upstream 11.25 --- zen/utf.h | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'zen/utf.h') diff --git a/zen/utf.h b/zen/utf.h index ca231602..56b1ff55 100644 --- a/zen/utf.h +++ b/zen/utf.h @@ -222,15 +222,9 @@ private: //---------------------------------------------------------------------------------------------------------------- -template inline void codePointToUtf(CodePoint cp, Function writeOutput, std::integral_constant) { codePointToUtf8 (cp, writeOutput); } //UTF8-char -template inline void codePointToUtf(CodePoint cp, Function writeOutput, std::integral_constant) { codePointToUtf16(cp, writeOutput); } //Windows: UTF16-wchar_t -template inline void codePointToUtf(CodePoint cp, Function writeOutput, std::integral_constant) { writeOutput(cp); } //other OS: UTF32-wchar_t - -template inline -void codePointToUtf(CodePoint cp, Function writeOutput) //"writeOutput" is a unary function taking a CharType -{ - return codePointToUtf(cp, writeOutput, std::integral_constant()); -} +template inline void codePointToUtfImpl(CodePoint cp, Function writeOutput, std::integral_constant) { codePointToUtf8 (cp, writeOutput); } //UTF8-char +template inline void codePointToUtfImpl(CodePoint cp, Function writeOutput, std::integral_constant) { codePointToUtf16(cp, writeOutput); } //Windows: UTF16-wchar_t +template inline void codePointToUtfImpl(CodePoint cp, Function writeOutput, std::integral_constant) { writeOutput(cp); } //other OS: UTF32-wchar_t //---------------------------------------------------------------------------------------------------------------- @@ -277,9 +271,18 @@ private: }; } + template using UtfDecoder = impl::UtfDecoderImpl; + +template inline +void codePointToUtf(impl::CodePoint cp, Function writeOutput) //"writeOutput" is a unary function taking a CharType +{ + return impl::codePointToUtfImpl(cp, writeOutput, std::integral_constant()); +} + + //------------------------------------------------------------------------------------------- template inline -- cgit