diff options
author | aap <aap@papnet.eu> | 2020-05-07 21:56:09 +0200 |
---|---|---|
committer | aap <aap@papnet.eu> | 2020-05-07 21:56:09 +0200 |
commit | a8f1505517f1baf061fe6b545906eaed09f851b8 (patch) | |
tree | 85a74573ba1184a384785181da42bb6e1160e16d /src/core/templates.h | |
parent | Merge branch 'master' of github.com:GTAmodding/re3 (diff) | |
download | re3-a8f1505517f1baf061fe6b545906eaed09f851b8.tar re3-a8f1505517f1baf061fe6b545906eaed09f851b8.tar.gz re3-a8f1505517f1baf061fe6b545906eaed09f851b8.tar.bz2 re3-a8f1505517f1baf061fe6b545906eaed09f851b8.tar.lz re3-a8f1505517f1baf061fe6b545906eaed09f851b8.tar.xz re3-a8f1505517f1baf061fe6b545906eaed09f851b8.tar.zst re3-a8f1505517f1baf061fe6b545906eaed09f851b8.zip |
Diffstat (limited to 'src/core/templates.h')
-rw-r--r-- | src/core/templates.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/core/templates.h b/src/core/templates.h index 921b109a..69844fa4 100644 --- a/src/core/templates.h +++ b/src/core/templates.h @@ -17,6 +17,16 @@ public: void clear(void){ this->allocPtr = 0; } + int getIndex(T *item){ + assert(item >= &this->store[0]); + assert(item < &this->store[n]); + return item - this->store; + } + T *getItem(int index){ + assert(index >= 0); + assert(index < n); + return &this->store[index]; + } }; template<typename T, typename U = T> |