commit fc795817ac684bb850e4f3c783b03f183166ad6b Author: Lenyiin <569963146@qq.com> Date: Sat Sep 7 18:07:06 2024 +0800 博客 https://blog.lenyiin.com/cpp-vector/ 的代码仓库 diff --git a/Linux/Makefile b/Linux/Makefile new file mode 100644 index 0000000..47c18b6 --- /dev/null +++ b/Linux/Makefile @@ -0,0 +1,6 @@ +vector:Vector.cc + g++ -o $@ $^ + +.PHONY:clean +clean: + rm -f vector \ No newline at end of file diff --git a/Linux/Vector.cc b/Linux/Vector.cc new file mode 100644 index 0000000..e3ec3ba --- /dev/null +++ b/Linux/Vector.cc @@ -0,0 +1,219 @@ +#include "Vector.hpp" +#include + +using namespace Lenyiin; + +void print_Vector(const Vector &v) +{ + Vector::const_iterator it = v.begin(); + while (it != v.end()) + { + cout << *it << " "; + ++it; + } + cout << endl; +} + +// Vector 容器遍历 +void test1() +{ + Vector v; + + // 插入 + v.push_back(1); + v.push_back(2); + v.push_back(3); + v.push_back(4); + v.push_back(5); + + // 查看容量 + cout << v.size() << endl; + cout << v.capacity() << endl + << endl; + ; + + // 1. 下标运算符 [] 遍历 + cout << "1. 下标运算符 [] 遍历 \t\t"; + for (size_t i = 0; i < v.size(); i++) + { + cout << v[i] << " "; + } + cout << endl; + + // 2. 迭代器遍历 + cout << "2. 迭代器遍历 \t\t\t"; + Vector::iterator it = v.begin(); + while (it != v.end()) + { + cout << *it << " "; + ++it; + } + cout << endl; + + // 3. const_iterator 迭代器遍历 + cout << "3. const_iterator 迭代器遍历 \t"; + print_Vector(v); + + // 4. 范围 for 遍历 + cout << "4. 范围 for 遍历 \t\t"; + for (auto &e : v) + { + cout << e << " "; + } + cout << endl; + + // 4. 范围 for 遍历 const + cout << "5. 范围 for 遍历 const \t\t"; + for (const auto &e : v) + { + cout << e << " "; + } + cout << endl; +} + +void test2() +{ + Vector v; + v.push_back(1); + v.push_back(2); + v.push_back(3); + v.push_back(4); + v.push_back(5); + v.push_back(6); + print_Vector(v); + cout << v.size() << endl; + cout << v.capacity() << endl + << endl; + ; + + // 随即插入 + v.insert(v.begin(), 0); + print_Vector(v); + + // 删除所有偶数 + Vector::iterator it = v.begin(); + while (it != v.end()) + { + if (*it % 2 == 0) + { + it = v.erase(it); + } + else + { + it++; + } + } + print_Vector(v); +} + +void test3() +{ + Vector v; + v.push_back(1); + v.push_back(2); + v.push_back(3); + v.push_back(4); + v.push_back(5); + v.push_back(6); + v.push_back(7); + + print_Vector(v); + cout << v.size() << endl; + cout << v.capacity() << endl + << endl; + ; + + // resize + v.resize(4); + print_Vector(v); + cout << v.size() << endl; + cout << v.capacity() << endl + << endl; + ; + + v.resize(8); + print_Vector(v); + cout << v.size() << endl; + cout << v.capacity() << endl + << endl; + ; + + v.resize(15); + print_Vector(v); + cout << v.size() << endl; + cout << v.capacity() << endl + << endl; + ; + + // 清除 + v.clear(); + print_Vector(v); + cout << v.size() << endl; + cout << v.capacity() << endl + << endl; + ; + + // reserve + v.reserve(20); + print_Vector(v); + cout << v.size() << endl; + cout << v.capacity() << endl + << endl; + ; +} + +void test4() +{ + // 默认构造 + Vector v1; + v1.push_back(1); + v1.push_back(2); + v1.push_back(3); + v1.push_back(4); + v1.push_back(5); + v1.push_back(6); + v1.push_back(7); + print_Vector(v1); + + // 拷贝构造 + Vector v2(v1); + print_Vector(v2); + + Vector v3; + v3.push_back(10); + v3.push_back(20); + v3.push_back(30); + v3.push_back(40); + + // 赋值 + v1 = v3; + print_Vector(v1); + print_Vector(v3); +} + +void test5() +{ + // 模板 + Vector v; + v.push_back("111"); + v.push_back("222"); + v.push_back("333"); + v.push_back("444"); + + for (auto e : v) + { + cout << e << " "; + } + cout << endl; +} + +int main() +{ + // test1(); + // test2(); + // test3(); + // test4(); + test5(); + + return 0; +} \ No newline at end of file diff --git a/Linux/Vector.hpp b/Linux/Vector.hpp new file mode 100644 index 0000000..29cdd4e --- /dev/null +++ b/Linux/Vector.hpp @@ -0,0 +1,302 @@ +#pragma once + +#include +#include + +using namespace std; + +namespace Lenyiin +{ + template + class Vector + { + public: + typedef T *iterator; + typedef const T *const_iterator; + + iterator begin() + { + return _start; + } + + iterator end() + { + return _finish; + } + + const_iterator begin() const + { + return _start; + } + + const_iterator end() const + { + return _finish; + } + + size_t size() const + { + return _finish - _start; + } + + size_t capacity() const + { + return _endofstorage - _start; + } + + // 默认构造 + Vector() + : _start(nullptr), _finish(nullptr), _endofstorage(nullptr) + { + } + + // 拷贝构造 + // Vector(const Vector& v) + //{ + // _start = new T[v.capacity()]; + // _finish = _start; + // _endofstorage = _start + v.capacity(); + + // for (size_t i = 0; i < v.size(); i++) + // { + // *_finish = v[i]; + // ++_finish; + // } + //} + + // 进阶写法 + Vector(const Vector &v) + : _start(nullptr), _finish(nullptr), _endofstorage(nullptr) + { + reserve(v.capacity()); + for (const auto &e : v) + { + push_back(e); + } + } + + // 赋值运算符重载 + // Vector& operator=(const Vector& v) + //{ + // if (this != &v) + // { + // delete[] _start; + // _start = new T[v.capacity()]; + + // //memcpy(_start, v._start, sizeof(T) * v.size()); 按字节拷贝,浅拷贝 + // for (size_t i = 0; i < v.size(); i++) + // { + // _start[i] = v._start[i]; // 调用的是 operator= 深拷贝 + // } + + // _finish = _start + v.size(); + // _endofstorage = _start + v.capacity(); + // } + // return *this; + //} + + // 进阶写法 + void swap(Vector &v) // 自己写的swap是浅拷贝,代价小 + { + std::swap(_start, v._start); + std::swap(_finish, v._finish); + std::swap(_endofstorage, v._endofstorage); + } + + Vector &operator=(Vector v) + { + swap(v); // 库里面的swap是深拷贝,代价极大 + return *this; + } + + // 移动构造函数 + Vector(Vector &&v) noexcept + : _start(v._start), _finish(v._finish), _endofstorage(v._endofstorage) + { + v._start = nullptr; + v._finish = nullptr; + v._endofstorage = nullptr; + } + + // 移动赋值运算符 + Vector &operator=(Vector &&v) noexcept + { + if (this != &v) + { + delete[] _start; + _start = v._start; + _finish = v._start + v.size(); + _endofstorage = v._start + v.capacity(); + v._start = nullptr; + v._finish = nullptr; + v._endofstorage = nullptr; + } + return *this; + } + + // 析构函数 + ~Vector() + { + if (_start) + { + delete[] _start; + } + _start = _finish = _endofstorage = nullptr; + } + + // 下标运算符重载 + T &operator[](size_t index) + { + if (index >= size()) + { + throw std::out_of_range("Index out of range"); + } + return _start[index]; + } + + const T &operator[](size_t index) const + { + if (index >= size()) + { + throw std::out_of_range("Index out of range"); + } + return _start[index]; + } + + // 动态扩容 + void reserve(size_t newcapacity) + { + if (newcapacity > capacity()) + { + T *tmp = new T[newcapacity]; // 分配新内存 + size_t len = size(); + if (_start) + { + for (size_t i = 0; i < len; i++) + { + tmp[i] = std::move(_start[i]); // 移动已有数据 + } + delete[] _start; // 释放旧的内存 + } + // 更新指针 + _start = tmp; + _finish = tmp + len; + _endofstorage = tmp + newcapacity; + } + } + + // resize 不仅会开空间,还会初始化 + void resize(size_t newsize, const T &val = T()) + { + if (newsize < size()) + { + _finish = _start + newsize; + } + else + { + if (newsize > capacity()) + { + reserve(newsize); + } + + while (_finish < _start + newsize) + { + *_finish = val; + ++_finish; + } + } + } + + void push_back(const T &data) + { + if (_finish == _endofstorage) + { + size_t newcapacity = capacity() == 0 ? 4 : capacity() * 2; + reserve(newcapacity); + } + + *_finish = data; + ++_finish; + } + + // 移动版本 + void push_back(T &&data) + { + if (_finish == _endofstorage) + { + reserve(capacity() == 0 ? 4 : capacity() * 2); + } + *_finish = std::move(data); // 使用 move 语义 + ++_finish; + } + + // 更安全的访问方式 + T &at(size_t index) + { + if (index >= size()) + { + throw std::out_of_range("Index out of bounds"); + } + return _start[index]; + } + + void pop_back() + { + assert(_start < _finish); + + --_finish; + } + + void clear() + { + _finish = _start; + } + + iterator insert(iterator pos, const T &data) + { + assert(pos <= _finish); + + if (_finish == _endofstorage) + { + size_t len = pos - _start; + size_t newcapacity = capacity() == 0 ? 4 : capacity() * 2; + reserve(newcapacity); + + // 如果增容,原来的pos就失效了,这里需要重新计算位置 + pos = _start + len; + } + + iterator end = _finish - 1; + while (end >= pos) + { + *(end + 1) = *end; + --end; + } + + *pos = data; + ++_finish; + + return pos; + } + + iterator erase(iterator pos) + { + assert(pos < _finish); + + iterator it = pos; + while (it < _finish) + { + *it = *(it + 1); + ++it; + } + --_finish; + + return pos; + } + + private: + iterator _start; + iterator _finish; + iterator _endofstorage; + }; +} \ No newline at end of file diff --git a/Linux/vector b/Linux/vector new file mode 100644 index 0000000..39c309d Binary files /dev/null and b/Linux/vector differ diff --git a/Windows_Vector/.vs/Windows_Vector/FileContentIndex/61bd94ed-e4fc-481c-ada3-754238e5f55a.vsidx b/Windows_Vector/.vs/Windows_Vector/FileContentIndex/61bd94ed-e4fc-481c-ada3-754238e5f55a.vsidx new file mode 100644 index 0000000..81ece6a Binary files /dev/null and b/Windows_Vector/.vs/Windows_Vector/FileContentIndex/61bd94ed-e4fc-481c-ada3-754238e5f55a.vsidx differ diff --git a/Windows_Vector/.vs/Windows_Vector/FileContentIndex/7561350e-bc04-4146-b0cc-7f5f67803fca.vsidx b/Windows_Vector/.vs/Windows_Vector/FileContentIndex/7561350e-bc04-4146-b0cc-7f5f67803fca.vsidx new file mode 100644 index 0000000..4fb3dcb Binary files /dev/null and b/Windows_Vector/.vs/Windows_Vector/FileContentIndex/7561350e-bc04-4146-b0cc-7f5f67803fca.vsidx differ diff --git a/Windows_Vector/.vs/Windows_Vector/FileContentIndex/ea2541f5-dab0-4bae-b844-9ae618c0ae25.vsidx b/Windows_Vector/.vs/Windows_Vector/FileContentIndex/ea2541f5-dab0-4bae-b844-9ae618c0ae25.vsidx new file mode 100644 index 0000000..415d755 Binary files /dev/null and b/Windows_Vector/.vs/Windows_Vector/FileContentIndex/ea2541f5-dab0-4bae-b844-9ae618c0ae25.vsidx differ diff --git a/Windows_Vector/.vs/Windows_Vector/v17/.suo b/Windows_Vector/.vs/Windows_Vector/v17/.suo new file mode 100644 index 0000000..46009e0 Binary files /dev/null and b/Windows_Vector/.vs/Windows_Vector/v17/.suo differ diff --git a/Windows_Vector/.vs/Windows_Vector/v17/Browse.VC.db b/Windows_Vector/.vs/Windows_Vector/v17/Browse.VC.db new file mode 100644 index 0000000..75225a1 Binary files /dev/null and b/Windows_Vector/.vs/Windows_Vector/v17/Browse.VC.db differ diff --git a/Windows_Vector/.vs/Windows_Vector/v17/ipch/AutoPCH/7cc13029d8007f11/VECTOR.ipch b/Windows_Vector/.vs/Windows_Vector/v17/ipch/AutoPCH/7cc13029d8007f11/VECTOR.ipch new file mode 100644 index 0000000..7716508 Binary files /dev/null and b/Windows_Vector/.vs/Windows_Vector/v17/ipch/AutoPCH/7cc13029d8007f11/VECTOR.ipch differ diff --git a/Windows_Vector/.vs/Windows_Vector/v17/ipch/AutoPCH/a810b729f088aec8/VECTOR.ipch b/Windows_Vector/.vs/Windows_Vector/v17/ipch/AutoPCH/a810b729f088aec8/VECTOR.ipch new file mode 100644 index 0000000..2ff7754 Binary files /dev/null and b/Windows_Vector/.vs/Windows_Vector/v17/ipch/AutoPCH/a810b729f088aec8/VECTOR.ipch differ diff --git a/Windows_Vector/Vector.cpp b/Windows_Vector/Vector.cpp new file mode 100644 index 0000000..47cd678 --- /dev/null +++ b/Windows_Vector/Vector.cpp @@ -0,0 +1,203 @@ +#include "Vector.hpp" +#include + +using namespace Lenyiin; + +void print_Vector(const Vector& v) +{ + Vector::const_iterator it = v.begin(); + while (it != v.end()) + { + cout << *it << " "; + ++it; + } + cout << endl; +} + +// Vector +void test1() +{ + Vector v; + + // + v.push_back(1); + v.push_back(2); + v.push_back(3); + v.push_back(4); + v.push_back(5); + + // 鿴 + cout << v.size() << endl; + cout << v.capacity() << endl << endl;; + + // 1. ± [] + cout << "1. ± [] \t\t"; + for (size_t i = 0; i < v.size(); i++) + { + cout << v[i] << " "; + } + cout << endl; + + // 2. + cout << "2. \t\t\t"; + Vector::iterator it = v.begin(); + while (it != v.end()) + { + cout << *it << " "; + ++it; + } + cout << endl; + + // 3. const_iterator + cout << "3. const_iterator \t"; + print_Vector(v); + + // 4. Χ for + cout << "4. Χ for \t\t"; + for (auto& e : v) + { + cout << e << " "; + } + cout << endl; + + // 4. Χ for const + cout << "5. Χ for const \t\t"; + for (const auto& e : v) + { + cout << e << " "; + } + cout << endl; +} + +void test2() +{ + Vector v; + v.push_back(1); + v.push_back(2); + v.push_back(3); + v.push_back(4); + v.push_back(5); + v.push_back(6); + print_Vector(v); + cout << v.size() << endl; + cout << v.capacity() << endl << endl;; + + // 漴 + v.insert(v.begin(), 0); + print_Vector(v); + + // ɾż + Vector::iterator it = v.begin(); + while (it != v.end()) + { + if (*it % 2 == 0) + { + it = v.erase(it); + } + else + { + it++; + } + } + print_Vector(v); +} + +void test3() +{ + Vector v; + v.push_back(1); + v.push_back(2); + v.push_back(3); + v.push_back(4); + v.push_back(5); + v.push_back(6); + v.push_back(7); + + print_Vector(v); + cout << v.size() << endl; + cout << v.capacity() << endl << endl;; + + // resize + v.resize(4); + print_Vector(v); + cout << v.size() << endl; + cout << v.capacity() << endl << endl;; + + v.resize(8); + print_Vector(v); + cout << v.size() << endl; + cout << v.capacity() << endl << endl;; + + v.resize(15); + print_Vector(v); + cout << v.size() << endl; + cout << v.capacity() << endl << endl;; + + // + v.clear(); + print_Vector(v); + cout << v.size() << endl; + cout << v.capacity() << endl << endl;; + + // reserve + v.reserve(20); + print_Vector(v); + cout << v.size() << endl; + cout << v.capacity() << endl << endl;; +} + +void test4() +{ + // ĬϹ + Vector v1; + v1.push_back(1); + v1.push_back(2); + v1.push_back(3); + v1.push_back(4); + v1.push_back(5); + v1.push_back(6); + v1.push_back(7); + print_Vector(v1); + + // + Vector v2(v1); + print_Vector(v2); + + Vector v3; + v3.push_back(10); + v3.push_back(20); + v3.push_back(30); + v3.push_back(40); + + // ֵ + v1 = v3; + print_Vector(v1); + print_Vector(v3); +} + +void test5() +{ + // ģ + Vector v; + v.push_back("111"); + v.push_back("222"); + v.push_back("333"); + v.push_back("444"); + + for (auto e : v) + { + cout << e << " "; + } + cout << endl; +} + +int main() +{ + //test1(); + //test2(); + //test3(); + //test4(); + test5(); + + return 0; +} \ No newline at end of file diff --git a/Windows_Vector/Vector.hpp b/Windows_Vector/Vector.hpp new file mode 100644 index 0000000..3d4031f --- /dev/null +++ b/Windows_Vector/Vector.hpp @@ -0,0 +1,300 @@ +#pragma once + +#include +#include + +using namespace std; + +namespace Lenyiin +{ + template + class Vector + { + public: + typedef T* iterator; + typedef const T* const_iterator; + + iterator begin() + { + return _start; + } + + iterator end() + { + return _finish; + } + + const_iterator begin() const + { + return _start; + } + + const_iterator end() const + { + return _finish; + } + + size_t size() const + { + return _finish - _start; + } + + size_t capacity() const + { + return _endofstorage - _start; + } + + // ĬϹ + Vector() + : _start(nullptr), _finish(nullptr), _endofstorage(nullptr) + { + } + + // + //Vector(const Vector& v) + //{ + // _start = new T[v.capacity()]; + // _finish = _start; + // _endofstorage = _start + v.capacity(); + + // for (size_t i = 0; i < v.size(); i++) + // { + // *_finish = v[i]; + // ++_finish; + // } + //} + + // д + Vector(const Vector& v) + : _start(nullptr), _finish(nullptr), _endofstorage(nullptr) + { + reserve(v.capacity()); + for (const auto& e : v) + { + push_back(e); + } + } + + // ֵ + //Vector& operator=(const Vector& v) + //{ + // if (this != &v) + // { + // delete[] _start; + // _start = new T[v.capacity()]; + + // //memcpy(_start, v._start, sizeof(T) * v.size()); ֽڿdz + // for (size_t i = 0; i < v.size(); i++) + // { + // _start[i] = v._start[i]; // õ operator=  + // } + + // _finish = _start + v.size(); + // _endofstorage = _start + v.capacity(); + // } + // return *this; + //} + + // д + void swap(Vector& v) // ԼдswapdzС + { + std::swap(_start, v._start); + std::swap(_finish, v._finish); + std::swap(_endofstorage, v._endofstorage); + } + + Vector& operator=(Vector v) + { + swap(v); // swapۼ + return *this; + } + + // ƶ캯 + Vector(Vector&& v) noexcept + : _start(v._start), _finish(v._finish), _endofstorage(v._endofstorage) + { + v._start = nullptr; + v._finish = nullptr; + v._endofstorage = nullptr; + } + + // ƶֵ + Vector& operator=(Vector&& v) noexcept + { + if (this != &v) { + delete[] _start; + _start = v._start; + _finish = v._start + v.size(); + _endofstorage = v._start + v.capacity(); + v._start = nullptr; + v._finish = nullptr; + v._endofstorage = nullptr; + } + return *this; + } + + // + ~Vector() + { + if (_start) + { + delete[] _start; + } + _start = _finish = _endofstorage = nullptr; + } + + // ± + T& operator[](size_t index) + { + if (index >= size()) + { + throw std::out_of_range("Index out of range"); + } + return _start[index]; + } + + const T& operator[](size_t index) const + { + if (index >= size()) + { + throw std::out_of_range("Index out of range"); + } + return _start[index]; + } + + // ̬ + void reserve(size_t newcapacity) + { + if (newcapacity > capacity()) + { + T* tmp = new T[newcapacity]; // ڴ + size_t len = size(); + if (_start) + { + for (size_t i = 0; i < len; i++) + { + tmp[i] = std::move(_start[i]); // ƶ + } + delete[] _start; // ͷžɵڴ + } + // ָ + _start = tmp; + _finish = tmp + len; + _endofstorage = tmp + newcapacity; + } + } + + // resize Ὺռ䣬ʼ + void resize(size_t newsize, const T& val = T()) + { + if (newsize < size()) + { + _finish = _start + newsize; + } + else + { + if (newsize > capacity()) + { + reserve(newsize); + } + + while (_finish < _start + newsize) + { + *_finish = val; + ++_finish; + } + } + } + + void push_back(const T& data) + { + if (_finish == _endofstorage) + { + size_t newcapacity = capacity() == 0 ? 4 : capacity() * 2; + reserve(newcapacity); + } + + *_finish = data; + ++_finish; + } + + // ƶ汾 + void push_back(T&& data) + { + if (_finish == _endofstorage) + { + reserve(capacity() == 0 ? 4 : capacity() * 2); + } + *_finish = std::move(data); // ʹ move + ++_finish; + } + + // ȫķʷʽ + T& at(size_t index) + { + if (index >= size()) { + throw std::out_of_range("Index out of bounds"); + } + return _start[index]; + } + + void pop_back() + { + assert(_start < _finish); + + --_finish; + } + + void clear() + { + _finish = _start; + } + + iterator insert(iterator pos, const T& data) + { + assert(pos <= _finish); + + if (_finish == _endofstorage) + { + size_t len = pos - _start; + size_t newcapacity = capacity() == 0 ? 4 : capacity() * 2; + reserve(newcapacity); + + // ݣԭposʧЧˣҪ¼λ + pos = _start + len; + } + + iterator end = _finish - 1; + while (end >= pos) + { + *(end + 1) = *end; + --end; + } + + *pos = data; + ++_finish; + + return pos; + } + + iterator erase(iterator pos) + { + assert(pos < _finish); + + iterator it = pos; + while (it < _finish) + { + *it = *(it + 1); + ++it; + } + --_finish; + + return pos; + } + + private: + iterator _start; + iterator _finish; + iterator _endofstorage; + }; +} \ No newline at end of file diff --git a/Windows_Vector/Windows_Vector.sln b/Windows_Vector/Windows_Vector.sln new file mode 100644 index 0000000..d1d00bf --- /dev/null +++ b/Windows_Vector/Windows_Vector.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.7.34221.43 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Windows_Vector", "Windows_Vector.vcxproj", "{0B0D33D6-AD9C-4BBE-A876-ABE358B97DF3}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {0B0D33D6-AD9C-4BBE-A876-ABE358B97DF3}.Debug|x64.ActiveCfg = Debug|x64 + {0B0D33D6-AD9C-4BBE-A876-ABE358B97DF3}.Debug|x64.Build.0 = Debug|x64 + {0B0D33D6-AD9C-4BBE-A876-ABE358B97DF3}.Debug|x86.ActiveCfg = Debug|Win32 + {0B0D33D6-AD9C-4BBE-A876-ABE358B97DF3}.Debug|x86.Build.0 = Debug|Win32 + {0B0D33D6-AD9C-4BBE-A876-ABE358B97DF3}.Release|x64.ActiveCfg = Release|x64 + {0B0D33D6-AD9C-4BBE-A876-ABE358B97DF3}.Release|x64.Build.0 = Release|x64 + {0B0D33D6-AD9C-4BBE-A876-ABE358B97DF3}.Release|x86.ActiveCfg = Release|Win32 + {0B0D33D6-AD9C-4BBE-A876-ABE358B97DF3}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {C1F44478-DEC0-4C54-A142-FF93B786AA79} + EndGlobalSection +EndGlobal diff --git a/Windows_Vector/Windows_Vector.vcxproj b/Windows_Vector/Windows_Vector.vcxproj new file mode 100644 index 0000000..fead14e --- /dev/null +++ b/Windows_Vector/Windows_Vector.vcxproj @@ -0,0 +1,138 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {0b0d33d6-ad9c-4bbe-a876-abe358b97df3} + WindowsVector + 10.0 + + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + + + + + + + + + + + + + + + + + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + + + + + + + + \ No newline at end of file diff --git a/Windows_Vector/Windows_Vector.vcxproj.filters b/Windows_Vector/Windows_Vector.vcxproj.filters new file mode 100644 index 0000000..7c06515 --- /dev/null +++ b/Windows_Vector/Windows_Vector.vcxproj.filters @@ -0,0 +1,27 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + 头文件 + + + + + 源文件 + + + \ No newline at end of file diff --git a/Windows_Vector/Windows_Vector.vcxproj.user b/Windows_Vector/Windows_Vector.vcxproj.user new file mode 100644 index 0000000..88a5509 --- /dev/null +++ b/Windows_Vector/Windows_Vector.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/Windows_Vector/x64/Debug/Vector.obj b/Windows_Vector/x64/Debug/Vector.obj new file mode 100644 index 0000000..cd5bb6b Binary files /dev/null and b/Windows_Vector/x64/Debug/Vector.obj differ diff --git a/Windows_Vector/x64/Debug/Windows_Vector.exe b/Windows_Vector/x64/Debug/Windows_Vector.exe new file mode 100644 index 0000000..bac5cd7 Binary files /dev/null and b/Windows_Vector/x64/Debug/Windows_Vector.exe differ diff --git a/Windows_Vector/x64/Debug/Windows_Vector.exe.recipe b/Windows_Vector/x64/Debug/Windows_Vector.exe.recipe new file mode 100644 index 0000000..9d7b7b6 --- /dev/null +++ b/Windows_Vector/x64/Debug/Windows_Vector.exe.recipe @@ -0,0 +1,11 @@ + + + + + E:\Git 仓库\公开仓库\4_Vector\Windows_Vector\x64\Debug\Windows_Vector.exe + + + + + + \ No newline at end of file diff --git a/Windows_Vector/x64/Debug/Windows_Vector.ilk b/Windows_Vector/x64/Debug/Windows_Vector.ilk new file mode 100644 index 0000000..be3b149 Binary files /dev/null and b/Windows_Vector/x64/Debug/Windows_Vector.ilk differ diff --git a/Windows_Vector/x64/Debug/Windows_Vector.log b/Windows_Vector/x64/Debug/Windows_Vector.log new file mode 100644 index 0000000..e7a42af --- /dev/null +++ b/Windows_Vector/x64/Debug/Windows_Vector.log @@ -0,0 +1,2 @@ + Vector.cpp + Windows_Vector.vcxproj -> E:\Git 仓库\公开仓库\4_Vector\Windows_Vector\x64\Debug\Windows_Vector.exe diff --git a/Windows_Vector/x64/Debug/Windows_Vector.pdb b/Windows_Vector/x64/Debug/Windows_Vector.pdb new file mode 100644 index 0000000..9db5560 Binary files /dev/null and b/Windows_Vector/x64/Debug/Windows_Vector.pdb differ diff --git a/Windows_Vector/x64/Debug/Windows_Vector.tlog/CL.command.1.tlog b/Windows_Vector/x64/Debug/Windows_Vector.tlog/CL.command.1.tlog new file mode 100644 index 0000000..53b8cbb Binary files /dev/null and b/Windows_Vector/x64/Debug/Windows_Vector.tlog/CL.command.1.tlog differ diff --git a/Windows_Vector/x64/Debug/Windows_Vector.tlog/CL.read.1.tlog b/Windows_Vector/x64/Debug/Windows_Vector.tlog/CL.read.1.tlog new file mode 100644 index 0000000..7d9a09b Binary files /dev/null and b/Windows_Vector/x64/Debug/Windows_Vector.tlog/CL.read.1.tlog differ diff --git a/Windows_Vector/x64/Debug/Windows_Vector.tlog/CL.write.1.tlog b/Windows_Vector/x64/Debug/Windows_Vector.tlog/CL.write.1.tlog new file mode 100644 index 0000000..2e68ed9 Binary files /dev/null and b/Windows_Vector/x64/Debug/Windows_Vector.tlog/CL.write.1.tlog differ diff --git a/Windows_Vector/x64/Debug/Windows_Vector.tlog/Cl.items.tlog b/Windows_Vector/x64/Debug/Windows_Vector.tlog/Cl.items.tlog new file mode 100644 index 0000000..c41fbc1 --- /dev/null +++ b/Windows_Vector/x64/Debug/Windows_Vector.tlog/Cl.items.tlog @@ -0,0 +1 @@ +E:\Git 仓库\公开仓库\4_Vector\Windows_Vector\Vector.cpp;E:\Git 仓库\公开仓库\4_Vector\Windows_Vector\x64\Debug\Vector.obj diff --git a/Windows_Vector/x64/Debug/Windows_Vector.tlog/Windows_Vector.lastbuildstate b/Windows_Vector/x64/Debug/Windows_Vector.tlog/Windows_Vector.lastbuildstate new file mode 100644 index 0000000..37ad902 --- /dev/null +++ b/Windows_Vector/x64/Debug/Windows_Vector.tlog/Windows_Vector.lastbuildstate @@ -0,0 +1,2 @@ +PlatformToolSet=v143:VCToolArchitecture=Native64Bit:VCToolsVersion=14.37.32822:TargetPlatformVersion=10.0.22000.0: +Debug|x64|E:\Git 仓库\公开仓库\4_Vector\Windows_Vector\| diff --git a/Windows_Vector/x64/Debug/Windows_Vector.tlog/link.command.1.tlog b/Windows_Vector/x64/Debug/Windows_Vector.tlog/link.command.1.tlog new file mode 100644 index 0000000..7d54fd3 Binary files /dev/null and b/Windows_Vector/x64/Debug/Windows_Vector.tlog/link.command.1.tlog differ diff --git a/Windows_Vector/x64/Debug/Windows_Vector.tlog/link.read.1.tlog b/Windows_Vector/x64/Debug/Windows_Vector.tlog/link.read.1.tlog new file mode 100644 index 0000000..52361e2 Binary files /dev/null and b/Windows_Vector/x64/Debug/Windows_Vector.tlog/link.read.1.tlog differ diff --git a/Windows_Vector/x64/Debug/Windows_Vector.tlog/link.write.1.tlog b/Windows_Vector/x64/Debug/Windows_Vector.tlog/link.write.1.tlog new file mode 100644 index 0000000..bd2a3d0 Binary files /dev/null and b/Windows_Vector/x64/Debug/Windows_Vector.tlog/link.write.1.tlog differ diff --git a/Windows_Vector/x64/Debug/Windows_Vector.vcxproj.FileListAbsolute.txt b/Windows_Vector/x64/Debug/Windows_Vector.vcxproj.FileListAbsolute.txt new file mode 100644 index 0000000..806f58a --- /dev/null +++ b/Windows_Vector/x64/Debug/Windows_Vector.vcxproj.FileListAbsolute.txt @@ -0,0 +1 @@ +E:\Git 仓库\公开仓库\4_Vector\Windows_Vector\x64\Debug\Windows_Vector.exe diff --git a/Windows_Vector/x64/Debug/vc143.idb b/Windows_Vector/x64/Debug/vc143.idb new file mode 100644 index 0000000..9d7b683 Binary files /dev/null and b/Windows_Vector/x64/Debug/vc143.idb differ diff --git a/Windows_Vector/x64/Debug/vc143.pdb b/Windows_Vector/x64/Debug/vc143.pdb new file mode 100644 index 0000000..95c30bb Binary files /dev/null and b/Windows_Vector/x64/Debug/vc143.pdb differ