AK: Ensure Utf16FlyString is hash-compatible with Utf16View/Utf16String

This commit is contained in:
Timothy Flynn 2025-08-06 09:09:13 -04:00 committed by Jelle Raaijmakers
parent 274f8ee462
commit 1b611fba67
Notes: github-actions[bot] 2025-08-07 00:07:15 +00:00
3 changed files with 25 additions and 0 deletions

View file

@ -8,6 +8,12 @@
#include <AK/Utf16FlyString.h>
static_assert(AK::Concepts::HashCompatible<Utf16String, Utf16FlyString>);
static_assert(AK::Concepts::HashCompatible<Utf16FlyString, Utf16String>);
static_assert(AK::Concepts::HashCompatible<Utf16View, Utf16FlyString>);
static_assert(AK::Concepts::HashCompatible<Utf16FlyString, Utf16View>);
TEST_CASE(empty_string)
{
Utf16FlyString fly {};

View file

@ -14,6 +14,9 @@
#include <AK/Utf16String.h>
#include <AK/Utf32View.h>
static_assert(AK::Concepts::HashCompatible<Utf16String, Utf16View>);
static_assert(AK::Concepts::HashCompatible<Utf16View, Utf16String>);
static Utf16String make_copy(Utf16String const& string)
{
return string.has_ascii_storage()