File tree Expand file tree Collapse file tree 1 file changed +1
-25
lines changed Expand file tree Collapse file tree 1 file changed +1
-25
lines changed Original file line number Diff line number Diff line change @@ -28,18 +28,7 @@ struct vector {
28
28
unsigned long size () const ;
29
29
bool empty () const ;
30
30
31
- // Basic iterator implementation for testing
32
- struct iterator {
33
- T* ptr;
34
- iterator (T* p) : ptr(p) {}
35
- T& operator *() { return *ptr; }
36
- T* operator ->() { return ptr; }
37
- iterator& operator ++() {
38
- ++ptr;
39
- return *this ;
40
- }
41
- bool operator !=(const iterator& other) const { return ptr != other.ptr ; }
42
- };
31
+ using iterator = T*;
43
32
44
33
iterator begin ();
45
34
iterator end ();
@@ -48,19 +37,6 @@ struct vector {
48
37
unsigned long sz;
49
38
};
50
39
51
- template <typename T>
52
- vector<T>::vector() : data(nullptr ), sz(0 ) {}
53
-
54
- template <typename T>
55
- typename vector<T>::iterator vector<T>::begin() {
56
- return iterator (data);
57
- }
58
-
59
- template <typename T>
60
- typename vector<T>::iterator vector<T>::end() {
61
- return iterator (data + sz);
62
- }
63
-
64
40
} // namespace std
65
41
66
42
struct Bar {
You can’t perform that action at this time.
0 commit comments