Update readme
[c11tester.git] / stl-model.h
index d787a2d7951d1cb0589f219a2678a7a4060f7ccd..53e412061d2178fc3f839882fa883400c57b4944 100644 (file)
@@ -5,7 +5,6 @@
 #include "mymemory.h"
 typedef unsigned int uint;
 
-
 template<typename _Tp>
 class mllnode {
 public:
@@ -165,6 +164,8 @@ private:
        uint _size;
 };
 
+class actionlist;
+
 template<typename _Tp>
 class sllnode {
 public:
@@ -179,6 +180,7 @@ private:
        _Tp val;
        template<typename T>
        friend class SnapList;
+       friend class actionlist;
 };
 
 template<typename _Tp>
@@ -367,7 +369,7 @@ public:
                _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--;
@@ -472,7 +474,7 @@ public:
                _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--;
@@ -537,6 +539,15 @@ public:
                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));