Website Summary Files Commits Branches @commit @diff @stats
path: root / src / List / List.h
blob: 3f30edc8247c22c9ef702494726065f9a8fdcf5b (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
#ifndef HEADER_LIST
#define HEADER_LIST

template <class T>
class List {
	T* elements;
	unsigned length;
	unsigned count;

	void resize();
	void free();
	void copyFrom(const List& other);

public:
	List(const T* elements, unsigned elementsCount);
	void add(const T& element);
	bool removeAt(unsigned index);
	T& operator[](unsigned index);
	const T& operator[](unsigned index) const;

	unsigned get_length() const;
	unsigned get_count() const;

	List();
	List& operator=(const List& other);
	List(const List& other);
	~List();

	List(List&& other);
	List& operator=(List&& other);
};

#endif