-
Notifications
You must be signed in to change notification settings - Fork 0
/
list.h
48 lines (33 loc) · 773 Bytes
/
list.h
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
36
37
38
39
40
41
42
43
44
45
46
47
48
#ifndef __LIST_H__
#define __LIST_H__
#include "../../allocator/allocator.h"
namespace stl
{
template <typename T>
struct list_node
{
list_node() : m_storage(), m_next(nullptr) { }
list_node(T data) : m_storage(data), m_next(nullptr) { }
T* get_m_data() noexcept { return &this->m_storage; }
const T* get_m_data() const noexcept { return &this->m_storage; }
list_node<T>* m_next;
private:
T m_storage;
};
template <typename T>
struct list_iterator
{
};
template <typename T>
struct const_list_iterator
{
};
template <
typename T,
typename Allocator = stl::allocator<T>
> class list
{
};
}
#include "list.tcc"
#endif // LIST_H