使用namespace 包裹不同的文件
#include <iostream>
#include<list>
namespace jj01
{
//开始设计
template<typename T>
using Lst=list<T,allocator<T>>;
void test()
}
使用:
int main()
{
jj01::test()
}
本文介绍了一种在C++中使用命名空间来组织代码的方法,并展示了如何定义和使用模板。通过一个具体的例子,演示了如何在命名空间内定义模板类型别名以及函数,并在主函数中调用这些函数。
使用namespace 包裹不同的文件
#include <iostream>
#include<list>
namespace jj01
{
//开始设计
template<typename T>
using Lst=list<T,allocator<T>>;
void test()
}
使用:
int main()
{
jj01::test()
}
160

被折叠的 条评论
为什么被折叠?