AK: Allow implicitly constructing a Utf16View from a Utf16FlyString

The same already works for String and FlyString into StringView, and for
Utf16String into Utf16View.
This commit is contained in:
Timothy Flynn 2025-08-06 09:11:38 -04:00 committed by Jelle Raaijmakers
commit 73154defa8
Notes: github-actions[bot] 2025-08-07 00:07:27 +00:00

View file

@ -39,6 +39,9 @@ public:
ALWAYS_INLINE explicit operator Utf16String() const { return to_utf16_string(); } ALWAYS_INLINE explicit operator Utf16String() const { return to_utf16_string(); }
ALWAYS_INLINE operator Utf16View() const& { return view(); }
explicit operator Utf16View() const&& = delete;
ALWAYS_INLINE Utf16String to_utf16_string() const ALWAYS_INLINE Utf16String to_utf16_string() const
{ {
Detail::Utf16StringBase copy { m_data }; Detail::Utf16StringBase copy { m_data };