MCPcopy Create free account
hub / github.com/boostorg/parser / write_cp_utf16

Function write_cp_utf16

include/boost/parser/detail/text/transcode_iterator.hpp:82–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

80
81 template<typename OutIter>
82 constexpr OutIter write_cp_utf16(char32_t cp, OutIter out)
83 {
84 if (cp < 0x10000) {
85 *out = static_cast<char16_t>(cp);
86 ++out;
87 } else {
88 *out = static_cast<char16_t>(cp >> 10) + high_surrogate_base;
89 ++out;
90 *out = static_cast<char16_t>(cp & 0x3ff) + low_surrogate_base;
91 ++out;
92 }
93 return out;
94 }
95
96 inline constexpr char32_t surrogates_to_cp(char16_t hi, char16_t lo)
97 {

Calls

no outgoing calls

Tested by

no test coverage detected