This commit is contained in:
Lenyiin 2024-09-07 18:07:06 +08:00
commit fc795817ac
34 changed files with 1247 additions and 0 deletions

6
Linux/Makefile Normal file
View File

@ -0,0 +1,6 @@
vector:Vector.cc
g++ -o $@ $^
.PHONY:clean
clean:
rm -f vector

219
Linux/Vector.cc Normal file
View File

@ -0,0 +1,219 @@
#include "Vector.hpp"
#include <string>
using namespace Lenyiin;
void print_Vector(const Vector<int> &v)
{
Vector<int>::const_iterator it = v.begin();
while (it != v.end())
{
cout << *it << " ";
++it;
}
cout << endl;
}
// Vector 容器遍历
void test1()
{
Vector<int> 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<int>::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<int> 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<int>::iterator it = v.begin();
while (it != v.end())
{
if (*it % 2 == 0)
{
it = v.erase(it);
}
else
{
it++;
}
}
print_Vector(v);
}
void test3()
{
Vector<int> 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<int> 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<int> v2(v1);
print_Vector(v2);
Vector<int> 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<string> 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;
}

302
Linux/Vector.hpp Normal file
View File

@ -0,0 +1,302 @@
#pragma once
#include <iostream>
#include <assert.h>
using namespace std;
namespace Lenyiin
{
template <class T>
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<T>& 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<T> &v)
: _start(nullptr), _finish(nullptr), _endofstorage(nullptr)
{
reserve(v.capacity());
for (const auto &e : v)
{
push_back(e);
}
}
// 赋值运算符重载
// Vector<T>& operator=(const Vector<T>& 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<T> &v) // 自己写的swap是浅拷贝代价小
{
std::swap(_start, v._start);
std::swap(_finish, v._finish);
std::swap(_endofstorage, v._endofstorage);
}
Vector<T> &operator=(Vector<T> 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;
};
}

BIN
Linux/vector Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

203
Windows_Vector/Vector.cpp Normal file
View File

@ -0,0 +1,203 @@
#include "Vector.hpp"
#include <string>
using namespace Lenyiin;
void print_Vector(const Vector<int>& v)
{
Vector<int>::const_iterator it = v.begin();
while (it != v.end())
{
cout << *it << " ";
++it;
}
cout << endl;
}
// Vector 容器遍历
void test1()
{
Vector<int> 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<int>::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<int> 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<int>::iterator it = v.begin();
while (it != v.end())
{
if (*it % 2 == 0)
{
it = v.erase(it);
}
else
{
it++;
}
}
print_Vector(v);
}
void test3()
{
Vector<int> 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<int> 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<int> v2(v1);
print_Vector(v2);
Vector<int> 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<string> 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;
}

300
Windows_Vector/Vector.hpp Normal file
View File

@ -0,0 +1,300 @@
#pragma once
#include <iostream>
#include <assert.h>
using namespace std;
namespace Lenyiin
{
template <class T>
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<T>& 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<T>& v)
: _start(nullptr), _finish(nullptr), _endofstorage(nullptr)
{
reserve(v.capacity());
for (const auto& e : v)
{
push_back(e);
}
}
// 赋值运算符重载
//Vector<T>& operator=(const Vector<T>& 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<T>& v) // 自己写的swap是浅拷贝代价小
{
std::swap(_start, v._start);
std::swap(_finish, v._finish);
std::swap(_endofstorage, v._endofstorage);
}
Vector<T>& operator=(Vector<T> 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;
};
}

View File

@ -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

View File

@ -0,0 +1,138 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>17.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{0b0d33d6-ad9c-4bbe-a876-abe358b97df3}</ProjectGuid>
<RootNamespace>WindowsVector</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="Vector.hpp" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="Vector.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="源文件">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="头文件">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="资源文件">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="Vector.hpp">
<Filter>头文件</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="Vector.cpp">
<Filter>源文件</Filter>
</ClCompile>
</ItemGroup>
</Project>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup />
</Project>

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<ProjectOutputs>
<ProjectOutput>
<FullPath>E:\Git 仓库\公开仓库\4_Vector\Windows_Vector\x64\Debug\Windows_Vector.exe</FullPath>
</ProjectOutput>
</ProjectOutputs>
<ContentFiles />
<SatelliteDlls />
<NonRecipeFileRefs />
</Project>

Binary file not shown.

View File

@ -0,0 +1,2 @@
 Vector.cpp
Windows_Vector.vcxproj -> E:\Git 仓库\公开仓库\4_Vector\Windows_Vector\x64\Debug\Windows_Vector.exe

Binary file not shown.

View File

@ -0,0 +1 @@
E:\Git 仓库\公开仓库\4_Vector\Windows_Vector\Vector.cpp;E:\Git 仓库\公开仓库\4_Vector\Windows_Vector\x64\Debug\Vector.obj

View File

@ -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\|

View File

@ -0,0 +1 @@
E:\Git 仓库\公开仓库\4_Vector\Windows_Vector\x64\Debug\Windows_Vector.exe

Binary file not shown.

Binary file not shown.