diff options
author | ForLoveOfCats <floc@unpromptedtirade.com> | 2022-04-20 15:33:41 -0400 |
---|---|---|
committer | Ali Mohammad Pur <Ali.mpfard@gmail.com> | 2022-04-21 09:12:37 +0430 |
commit | 79a2088a13460f832c450fda682ef5c6e92405c6 (patch) | |
tree | 65988145beea304ebe154b80702a3eb9e4f3d33e /AK | |
parent | a7fe3183f586b41204fe07ed617f32acad5929b3 (diff) | |
download | serenity-79a2088a13460f832c450fda682ef5c6e92405c6.zip |
AK: Make `Vector::contains_slow` templated
This allows for calling this function with any argument type for which
the appropriate traits and operators have been implemented so it can be
compared to the Vector's item type
Diffstat (limited to 'AK')
-rw-r--r-- | AK/Vector.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/AK/Vector.h b/AK/Vector.h index 88c0ba74c2..a68628282e 100644 --- a/AK/Vector.h +++ b/AK/Vector.h @@ -203,7 +203,8 @@ public: return TypedTransfer<StorageType>::compare(data(), other.data(), size()); } - bool contains_slow(VisibleType const& value) const + template<typename V> + bool contains_slow(V const& value) const { for (size_t i = 0; i < size(); ++i) { if (Traits<VisibleType>::equals(at(i), value)) |