mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-26 01:51:41 +00:00
[wpiutil] jni_util: Add size, operator[] to JArrayRef (#3569)
These make it usable more like a standard container.
This commit is contained in:
@@ -194,6 +194,10 @@ class JArrayRefBase : public JArrayRefInner<JArrayRefBase<T>, T> {
|
||||
return {this->m_elements, this->m_size};
|
||||
}
|
||||
|
||||
size_t size() const { return this->m_size; }
|
||||
T& operator[](size_t i) { return this->m_elements[i]; }
|
||||
const T& operator[](size_t i) const { return this->m_elements[i]; }
|
||||
|
||||
JArrayRefBase(const JArrayRefBase&) = delete;
|
||||
JArrayRefBase& operator=(const JArrayRefBase&) = delete;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user