blob: 378d8e3148c99456cab02b2c9746569992ebcb83 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
#pragma once
namespace base
{
template<typename T>
class cSList
{
public:
struct tSItem
{
tSItem* next;
T item;
};
// extra field on PS2
tSItem* first;
cSList() { first = nil; }
void Insert(tSItem* item) { tSItem* n = first; first = item; item->next = n; }
void Remove(tSItem* item) {
if (first == item) {
first = item->next;
return;
}
tSItem* i = first;
while (i && i->next != item)
i = i->next;
assert(i);
i->next = item->next;
}
};
}
|