diff --git a/AK/String.h b/AK/String.h index d59b00c3b09..79f66347bb0 100644 --- a/AK/String.h +++ b/AK/String.h @@ -287,7 +287,7 @@ public: [[nodiscard]] String reverse() const; template - [[nodiscard]] ALWAYS_INLINE constexpr bool is_one_of(Ts... strings) const + [[nodiscard]] ALWAYS_INLINE constexpr bool is_one_of(Ts&&... strings) const { return (... || this->operator==(forward(strings))); } diff --git a/AK/StringView.h b/AK/StringView.h index 2d03af4eace..519e5afdf8a 100644 --- a/AK/StringView.h +++ b/AK/StringView.h @@ -216,7 +216,7 @@ public: [[nodiscard]] bool is_whitespace() const { return StringUtils::is_whitespace(*this); } template - [[nodiscard]] ALWAYS_INLINE constexpr bool is_one_of(Ts... strings) const + [[nodiscard]] ALWAYS_INLINE constexpr bool is_one_of(Ts&&... strings) const { return (... || this->operator==(forward(strings))); }