0%

cpp

CPP相关

Blueprint with C++

C++

vector source code

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
//MSVC\14.29\include\vector
namespace std
{
// CLASS TEMPLATE _Vector_const_iterator
template<class _Myvec>
class _Vector_const_iterator
{//这里面写了很多迭代器操作符的重载};

// CLASS TEMPLATE _Vector_iterator
template <class _Myvec>
class _Vector_iterator : public _Vector_const_iterator<_Myvec>{};

// CLASS TEMPLATE _Vector_val
template <class _Val_types>
class _Vector_val{};

// CLASS TEMPLATE vector
template <class _Ty, class _Alloc = allocator<_Ty>>
class vector
{
//构造函数
//成员函数 push_back,insert,assign,resize...
};

template <class _Ret>
struct _Vbase_compare_three_way{};


// CLASS TEMPLATE _Vb_val
template <class _Alloc>
class _Vb_val{};

// CLASS vector<bool>
template <class _Alloc> : public _Vb_val<_Alloc>
class vector<bool, _Alloc>{};
}

插入图片测试