summaryrefslogtreecommitdiffstats
path: root/src/core/templates.h
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2020-05-07 22:22:15 +0200
committerNikolay Korolev <nickvnuk@gmail.com>2020-05-07 22:22:15 +0200
commitb99346e6ca8bd6ee8d8d6b7cf1b21b9d06b0ab04 (patch)
treeab07a4b632108268d62700baf702536c1e87b4f9 /src/core/templates.h
parentintermediate changes (diff)
parentCBaseModelInfo done (diff)
downloadre3-b99346e6ca8bd6ee8d8d6b7cf1b21b9d06b0ab04.tar
re3-b99346e6ca8bd6ee8d8d6b7cf1b21b9d06b0ab04.tar.gz
re3-b99346e6ca8bd6ee8d8d6b7cf1b21b9d06b0ab04.tar.bz2
re3-b99346e6ca8bd6ee8d8d6b7cf1b21b9d06b0ab04.tar.lz
re3-b99346e6ca8bd6ee8d8d6b7cf1b21b9d06b0ab04.tar.xz
re3-b99346e6ca8bd6ee8d8d6b7cf1b21b9d06b0ab04.tar.zst
re3-b99346e6ca8bd6ee8d8d6b7cf1b21b9d06b0ab04.zip
Diffstat (limited to 'src/core/templates.h')
-rw-r--r--src/core/templates.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/core/templates.h b/src/core/templates.h
index 44ab566b..aa71fe5d 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>