Browse Source

Merge pull request #1455 from AThousandShips/localvector_has

[Core] Add `LocalVector::has` for convenience
David Snopek 1 year ago
parent
commit
3d0d9cd0e2
1 changed files with 4 additions and 0 deletions
  1. 4 0
      include/godot_cpp/templates/local_vector.hpp

+ 4 - 0
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;