Optionaly add compatibility operators

pull/1457/head
A Thousand Ships 2024-05-07 10:43:41 +02:00
parent 12a1283663
commit d0bdd6096c
No known key found for this signature in database
GPG Key ID: 2033189A662F8BD7
1 changed files with 10 additions and 0 deletions

View File

@ -523,6 +523,11 @@ public:
}
}
// Index operator, kept for compatibility.
_FORCE_INLINE_ T &operator[](int p_index) {
return get(p_index);
}
// Random access to elements, use with care,
// do not use for iteration.
T &get(int p_index) {
@ -538,6 +543,11 @@ public:
return I->get();
}
// Index operator, kept for compatibility.
_FORCE_INLINE_ const T &operator[](int p_index) const {
return get(p_index);
}
// Random access to elements, use with care,
// do not use for iteration.
const T &get(int p_index) const {