summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorA Thousand Ships <96648715+AThousandShips@users.noreply.github.com>2024-05-06 17:47:21 +0200
committerA Thousand Ships <96648715+AThousandShips@users.noreply.github.com>2024-05-06 17:47:21 +0200
commit505076c9a97adb72386ce352610048ea93040167 (patch)
tree93d87ba0797b10e9316feace8d421aeeb4354f19
parent54fe2f9891525891a52c47ffbd190d15c38cccab (diff)
downloadredot-cpp-505076c9a97adb72386ce352610048ea93040167.tar.gz
[Core] Add `LocalVector::has` for convenience
-rw-r--r--include/godot_cpp/templates/local_vector.hpp4
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;