1 Star 0 Fork 0

CoderQi/cpp

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
类模板成员函数类外实现.cpp 839 Bytes
一键复制 编辑 原始数据 按行查看 历史
CoderQi 提交于 2023-04-25 20:29 +08:00 . 类模板(毕)
//#include<iostream>
//using namespace std;
//template<class T1,class T2>
//class Person
//{
//public:
// Person(T1 name, T2 age);
// /*{
// this->m_Name = name;
// this->m_Age = age;
//
//
// }*/
// void showPerson();
// /*{
// cout << "姓名:" << this->m_Name << " 年龄" << this->m_Age << endl;
//
// }*/
//
//
// T1 m_Name;
// T2 m_Age;
//};
//
////成员函数类外实现
//template<class T1,class T2>
//Person<T1, T2>::Person(T1 name, T2 age)
//{
// this->m_Name = name;
// this->m_Age = age;
//
//}
//template<typename T1,typename T2>
//void Person<T1, T2>::showPerson()
//{
// cout << "姓名:" << this->m_Name << " 年龄" << this->m_Age << endl;
//}
//
//
//void test01()
//{
// Person<string, int>P("Tom", 20);
// P.showPerson();
//}
//int main()
//{
// test01();
//
//
// return 0;
//}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/programmercg/cpp.git
git@gitee.com:programmercg/cpp.git
programmercg
cpp
cpp
master

搜索帮助