33 inline unsigned int num()
const
38 inline T*
at(
unsigned int pos)
const
40 return (pos < _length) ? _block[pos] :
nullptr;
55 return at(_length - 1);
60 return at(_length - 1);
63 virtual unsigned int append(
T*
elem);
65 virtual void swap(
unsigned int p1,
unsigned int p2);
70 virtual void destroy();
72 virtual void deleteAt(
unsigned int pos);
74 virtual void deleteLast();
76 virtual int remove(
T*
elem);
78 virtual int lookup(
T*
elem)
const;
81 virtual int removeUnSwapped(
T*
elem);
83 virtual void replace(
T*
elem,
unsigned int pos);
89 unsigned int _capacity;
101 _block =
new T*[init];
103 for (
unsigned int i = 0;
i < init;
i++) {
129 for (
unsigned int i = 0;
i < _capacity;
i++) {
141 if (_length < _capacity) {
142 _block[_length] =
elem;
174 if (pos >= _length) {
178 if (pos != _length - 1) {
179 swap(pos, _length - 1);
198 for (
unsigned int i = 0;
i < _length;
i++) {
200 pos =
static_cast<int>(
i);
211 int pos = lookup(
elem);
213 deleteAt(
static_cast<unsigned int>(pos));
222 int pos = lookup(
elem);
224 for (
unsigned int i =
static_cast<unsigned int>(pos);
i < _length - 1;
i++) {
225 _block[
i] = _block[
i + 1];
Dynamic templated vector.
unsigned int num() const
Returns the number of elements in this vector.
T * at(unsigned int pos) const
Returns the element at the given position, returns NULL if out of range.
T * last()
Returns the last element.
T * first()
Returns the first element.
const T * first() const
Returns the first element.
const T * last() const
Returns the last element.
Target mlrange_cast(Source arg)
Generic version of checked ML casts.