From c715569d1d52ebc2a99544a98bedbfdabf8fd3a7 Mon Sep 17 00:00:00 2001 From: aap Date: Thu, 7 May 2020 21:55:54 +0200 Subject: CBaseModelInfo done --- src/core/templates.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/core/templates.h') 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 -- cgit v1.2.3