AK: Disallow String::from_utf8 on FlyString and String

This commit is contained in:
Shannon Booth 2023-12-10 15:42:30 +13:00 committed by Andreas Kling
parent 6ce0d588ee
commit 5f2f26451d
Notes: sideshowbarker 2024-07-17 04:49:48 +09:00

View file

@ -67,7 +67,7 @@ public:
// Creates a new String from a sequence of UTF-8 encoded code points.
static ErrorOr<String> from_utf8(StringView);
template<typename T>
requires(IsOneOf<RemoveCVReference<T>, DeprecatedString, DeprecatedFlyString>)
requires(IsOneOf<RemoveCVReference<T>, DeprecatedString, DeprecatedFlyString, FlyString, String>)
static ErrorOr<String> from_utf8(T&&) = delete;
// Creates a new String by reading byte_count bytes from a UTF-8 encoded Stream.