-
Notifications
You must be signed in to change notification settings - Fork 77
Expand file tree
/
Copy pathvector.h
More file actions
75 lines (64 loc) · 2.33 KB
/
vector.h
File metadata and controls
75 lines (64 loc) · 2.33 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#ifndef _GHLIBCPP_VECTOR
#define _GHLIBCPP_VECTOR
#include <iterator>
#include <string>
#include "memory.h"
#include "empty.h"
namespace std {
template <class T, class Allocator = std::allocator<T>> class vector {
public:
typedef size_t size_type;
typedef T value_type;
typedef value_type &reference;
typedef const value_type &const_reference;
using difference_type = signed int;
typedef __iterator<T> iterator;
typedef __iterator<const T> const_iterator;
iterator begin();
iterator end();
const_iterator cbegin() const;
const_iterator cend() const;
size_type size() const noexcept;
void resize(size_type sz);
void resize(size_type sz, const T &c);
constexpr vector() : vector(Allocator()) {}
constexpr explicit vector(const Allocator &);
explicit vector(size_type n, const Allocator & = Allocator());
vector(size_type n, const T &value, const Allocator & = Allocator());
constexpr vector(const vector &x);
constexpr vector(vector &&x);
constexpr vector(const vector &, const Allocator &);
constexpr vector(vector &&, const Allocator &);
vector(initializer_list<T>, const Allocator & = Allocator());
constexpr vector &operator=(const vector &x);
constexpr vector &operator=(vector &&x);
constexpr void clear() noexcept;
bool empty() const noexcept;
template <class... Args> void emplace_back(Args &&...args);
void push_back(const T &x);
void push_back(T &&x);
void pop_back();
template <class... Args>
iterator emplace(const_iterator position, Args &&...args);
iterator insert(const_iterator position, const T &x);
iterator insert(const_iterator position, T &&x);
iterator insert(const_iterator position, size_type n, const T &x);
template <class InputIterator>
iterator insert(const_iterator position, InputIterator first,
InputIterator last);
iterator insert(const_iterator position, initializer_list<T> il);
iterator erase(iterator position);
iterator erase(const_iterator position);
iterator erase(iterator first, iterator last);
iterator erase(const_iterator first, const_iterator last);
reference operator[](size_type n);
const_reference operator[](size_type n) const;
reference at(size_type n);
reference front();
const_reference front() const;
reference back();
const_reference back() const;
~vector();
};
} // namespace std
#endif // _GHLIBCPP_VECTOR