projects
/
c11tester.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update readme
[c11tester.git]
/
stl-model.h
diff --git
a/stl-model.h
b/stl-model.h
index d787a2d7951d1cb0589f219a2678a7a4060f7ccd..53e412061d2178fc3f839882fa883400c57b4944 100644
(file)
--- a/
stl-model.h
+++ b/
stl-model.h
@@
-5,7
+5,6
@@
#include "mymemory.h"
typedef unsigned int uint;
#include "mymemory.h"
typedef unsigned int uint;
-
template<typename _Tp>
class mllnode {
public:
template<typename _Tp>
class mllnode {
public:
@@
-165,6
+164,8
@@
private:
uint _size;
};
uint _size;
};
+class actionlist;
+
template<typename _Tp>
class sllnode {
public:
template<typename _Tp>
class sllnode {
public:
@@
-179,6
+180,7
@@
private:
_Tp val;
template<typename T>
friend class SnapList;
_Tp val;
template<typename T>
friend class SnapList;
+ friend class actionlist;
};
template<typename _Tp>
};
template<typename _Tp>
@@
-367,7
+369,7
@@
public:
_size(_capacity),
capacity(_capacity),
array((type *) model_malloc(sizeof(type) * _capacity)) {
_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--;
}
void pop_back() {
_size--;
@@
-472,7
+474,7
@@
public:
_size(_capacity),
capacity(_capacity),
array((type *) snapshot_malloc(sizeof(type) * _capacity)) {
_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--;
}
void pop_back() {
_size--;
@@
-537,6
+539,15
@@
public:
array[index] = item;
}
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));
void removeAt(uint index) {
for (uint i = index;(i + 1) < _size;i++) {
set(i, at(i + 1));