There was an error while loading. Please reload this page.
1 parent b1c30d7 commit ff997b1Copy full SHA for ff997b1
1 file changed
src/Processing.h
@@ -2681,6 +2681,17 @@ class Array {
2681
return data[(size_t)index];
2682
}
2683
2684
+ // get/set methods for Java-style access and bool[] compatibility
2685
+ T get(int index) const {
2686
+ if (index < 0 || index >= (int)data.size())
2687
+ throw std::out_of_range("Array index " + std::to_string(index) + " out of bounds");
2688
+ return data[(size_t)index];
2689
+ }
2690
+ void set(int index, const T& val) {
2691
2692
2693
+ data[(size_t)index] = val;
2694
2695
auto begin() { return data.begin(); }
2696
auto end() { return data.end(); }
2697
auto begin() const { return data.begin(); }
0 commit comments