+ // nb allocated elements
+ size_t size() const
+ {
+ return _freeList.size();
+ }
+
+ // nb used elements
+ size_t nbElements() const
+ {
+ return _maxOccupied + 1 - _nbHoles;
+ }
+
+ // return an element w/o any check
+ const X* operator[]( size_t i ) const // i < size()
+ {
+ int chunkId = i / _chunkSize;
+ int rank = i - chunkId * _chunkSize;
+ return _chunkList[ chunkId ] + rank;
+ }
+
+ // return only being used element
+ const X* at( size_t i ) const // i < size()
+ {
+ if ( i >= size() || _freeList[ i ] )
+ return 0;
+
+ int chunkId = i / _chunkSize;
+ int rank = i - chunkId * _chunkSize;
+ return _chunkList[ chunkId ] + rank;
+ }
+