Make Vector bsearch method const.

This commit is contained in:
Lukas Tenbrink
2025-11-08 12:26:28 +01:00
parent 22a28e07cc
commit 109d3d8530
13 changed files with 60 additions and 29 deletions

View File

@@ -175,12 +175,12 @@ public:
sorter.sort(data, len);
}
Size bsearch(const T &p_value, bool p_before) {
Size bsearch(const T &p_value, bool p_before) const {
return bsearch_custom<Comparator<T>>(p_value, p_before);
}
template <typename Comparator, typename Value, typename... Args>
Size bsearch_custom(const Value &p_value, bool p_before, Args &&...args) {
Size bsearch_custom(const Value &p_value, bool p_before, Args &&...args) const {
return span().bisect(p_value, p_before, Comparator{ args... });
}
@@ -188,12 +188,6 @@ public:
return *this;
}
#ifndef DISABLE_DEPRECATED
Vector<T> _duplicate_bind_compat_112290() {
return *this;
}
#endif // DISABLE_DEPRECATED
void ordered_insert(const T &p_val) {
Size i;
for (i = 0; i < _cowdata.size(); i++) {