AK: Implement UTF-16 string-to-number conversions

This commit is contained in:
Timothy Flynn 2025-06-27 13:56:17 -04:00 committed by Tim Flynn
commit d40e3af697
Notes: github-actions[bot] 2025-07-18 16:47:05 +00:00
6 changed files with 163 additions and 45 deletions

View file

@ -88,6 +88,12 @@ public:
StringView ascii_view() const&& = delete;
Utf16View utf16_view() const&& = delete;
template<Arithmetic T>
ALWAYS_INLINE Optional<T> to_number(TrimWhitespace trim_whitespace = TrimWhitespace::Yes) const
{
return utf16_view().to_number<T>(trim_whitespace);
}
ALWAYS_INLINE Utf16StringBase& operator=(Utf16StringBase const& other)
{
if (&other != this) {