summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--include/unicode.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/unicode.h b/include/unicode.h
index c9f2331..8e120ad 100644
--- a/include/unicode.h
+++ b/include/unicode.h
@@ -112,7 +112,7 @@ namespace unicode::detail {
template<size_t n>
inline static internal_type value_byte0_of(value_type b) noexcept
{
- return static_cast<char32_t>(b & (0b1111111 >> n)) << ((n - 1) * 6);
+ return static_cast<internal_type>(b & (0b1111111 >> n)) << ((n - 1) * 6);
}
template<class X = value_type, typename std::enable_if<(sizeof(X) == 1), bool>::type = true>
@@ -173,7 +173,7 @@ namespace unicode::detail {
throw std::invalid_argument("Bad input: 2 malformed UTF-16 surrogates");
std::advance(iterator, 2);
- return (static_cast<char32_t>(unit0 & 0x03FF) << 10 | (unit1 & 0x03FF)) + 0x10000;
+ return (static_cast<internal_type>(unit0 & 0x03FF) << 10 | (unit1 & 0x03FF)) + 0x10000;
}
}