【发布时间】:2010-02-20 04:39:37
【问题描述】:
我在看STL源代码(原来是既好玩又好用),偶然发现了这种东西
//file backwards/auto_ptr.h, but also found on many others.
template<typename _Tp>
class auto_ptr
//Question is about this:
template<>
class auto_ptr<void>
是否添加了template<> 部分以避免类重复?
【问题讨论】:
-
你的标题很混乱,你到底是什么意思?
-
我在问模板有什么用。
-
这只是用于说“这是一个模板类,但我不需要任何模板”的语法,因为您将自己填写它。