diff options
| author | David Snopek <dsnopek@gmail.com> | 2024-05-07 12:55:59 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-07 12:55:59 -0500 |
| commit | 3d0d9cd0e2314bd531424e0ee45d4a3c8dcabe33 (patch) | |
| tree | 4aeebacbc8d2381769a5a2c15f5b96c238ed9ab0 | |
| parent | 43be24f34ccaba20faf05c76d724edb2a5339931 (diff) | |
| parent | 505076c9a97adb72386ce352610048ea93040167 (diff) | |
| download | redot-cpp-3d0d9cd0e2314bd531424e0ee45d4a3c8dcabe33.tar.gz | |
Merge pull request #1455 from AThousandShips/localvector_has
[Core] Add `LocalVector::has` for convenience
| -rw-r--r-- | include/godot_cpp/templates/local_vector.hpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/godot_cpp/templates/local_vector.hpp b/include/godot_cpp/templates/local_vector.hpp index 5dad32e..10af2a9 100644 --- a/include/godot_cpp/templates/local_vector.hpp +++ b/include/godot_cpp/templates/local_vector.hpp @@ -257,6 +257,10 @@ public: return -1; } + bool has(const T &p_val) const { + return find(p_val) != -1; + } + template <typename C> void sort_custom() { U len = count; |
