AK: Fix declaration of {String,StringView}::is_one_of

The declarations need to consume the variadic parameters as "Ts&&..."
for the parameters to be forwarding references.
This commit is contained in:
Timothy Flynn 2021-07-31 19:27:25 -04:00 committed by Ali Mohammad Pur
parent 1e10d6d7ce
commit 011514a384
2 changed files with 2 additions and 2 deletions

View file

@ -287,7 +287,7 @@ public:
[[nodiscard]] String reverse() const;
template<typename... Ts>
[[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<Ts>(strings)));
}

View file

@ -216,7 +216,7 @@ public:
[[nodiscard]] bool is_whitespace() const { return StringUtils::is_whitespace(*this); }
template<typename... Ts>
[[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<Ts>(strings)));
}