STL基础

1  It's important to realize that these templates are not class and member function definitions. Rather, they are instructions to the C++ compiler about how to generate class and member function definitions.  所以, 模板类是在编译时被替换的, 当编译时, 参数会替换成实际参数, 就像宏的处理一样.

 

2  Unless you have a compiler that has implemented the new export keyword, placing the template member functions in a separate implementation file won't work. Because the templates aren't functions, they can't be compiled separately.   意思就是, 模板类不能像普通类那样, 声明在.H中, 实现在.CPP中. 而是声明和实现都必须要同一个头文件中.

 

3

Using a Template Class
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值