#include "mymemory.h"
typedef unsigned int uint;
-
template<typename _Tp>
class mllnode {
public:
uint _size;
};
+class actionlist;
+
template<typename _Tp>
class sllnode {
public:
_Tp val;
template<typename T>
friend class SnapList;
+ friend class actionlist;
};
template<typename _Tp>
_size(_capacity),
capacity(_capacity),
array((type *) model_malloc(sizeof(type) * _capacity)) {
- memcpy(array, _array, capacity * sizeof(type));
+ real_memcpy(array, _array, capacity * sizeof(type));
}
void pop_back() {
_size--;
_size(_capacity),
capacity(_capacity),
array((type *) snapshot_malloc(sizeof(type) * _capacity)) {
- memcpy(array, _array, capacity * sizeof(type));
+ real_memcpy(array, _array, capacity * sizeof(type));
}
void pop_back() {
_size--;
array[index] = item;
}
+ void remove(type item) {
+ for(uint i = 0;i < _size;i++) {
+ if (at(i) == item) {
+ removeAt(i);
+ return;
+ }
+ }
+ }
+
void removeAt(uint index) {
for (uint i = index;(i + 1) < _size;i++) {
set(i, at(i + 1));