mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-21 23:20:20 +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
Notes:
sideshowbarker
2024-07-18 07:34:23 +09:00
Author: https://github.com/trflynn89 Commit: https://github.com/SerenityOS/serenity/commit/011514a3840 Pull-request: https://github.com/SerenityOS/serenity/pull/9142 Reviewed-by: https://github.com/alimpfard
2 changed files with 2 additions and 2 deletions
|
@ -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