mirror of
https://github.com/SerenityOS/serenity
synced 2024-10-15 04:13:11 +00:00
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:
parent
1e10d6d7ce
commit
011514a384
|
@ -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)));
|
||||
}
|
||||
|
|
|
@ -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)));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue