[英]is it possible define parameterized list in preprocessor
有没有一种方法可以使用#define
指令来定义参数化列表?
我的意思是这样的
#define List<T> std::list<T>
我不想使用using namespace std;
并通过预处理器使用简化版本。
还是应该为List
创建单独的定义(如StringList
)? 还是像List<String>
这样的东西?
使用typedef
代替宏:
template <typename T>
using List = std::list<T>;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.