网站首页
编程语言
数据库
系统相关
其他分享
编程问答
addres
2024-07-16
类模板案例——数组类封装(vector<>的逻辑代码)
.hpp文件#pragma#include<iostream>usingnamespacestd;template<classT>classMy_arry{public: My_arry(intcapacity)//赋初值 { this->m_capacity=capacity;//容量 this->m_Arry_size=0;//大小 this->m_Arry_Addres=newT[capacity];