typedef on a template
来源:互联网 发布:地名数据库 编辑:程序博客网 时间:2024/05/16 05:08
编译real time rendering terrain的时候遇到的。。估计是版本的问题
eg:
template <class T>
class cResourcePool
{
public:
typedef T DataType; //注意,typedef 自己
cResourcePool(){}
~cResourcePool(){}
public:
DataType* CreateResource( const cString& resourceName ); //注意 返回类型
};
、、、、、、、、、、错误实现(相对于2005)、、、、、、、、、、、、
template <class T>
inline cResourcePool<T>::DataType* cResourcePool::CreateReousrce( const cString& resourceName)
{
*********略过********
}
*************************************
*修改方法*
//无非就是加了一个typename
************************************
template <class T>
inline typename cResourcePool<T>::DataType* cResourcePool::CreateResource(const cString& resourceName)
{
*************
}
不知道为什么要加typename
这有个说法不知道是不是这个关系
“
typename stree<T>::iterator 这样表明iterator是一种类型,前面不加typename 而单是stree<T>::iterator 的话表明iterator是stree<T>内的成员变量”
- typedef on a template
- Writing a Copy-On-Write Holder Template
- Visual C++ Tips: error C2823: a typedef template is illegal
- Typedef inside template class
- vector,template,typedef,typename
- template specialization on template class
- linux编译中error: no arguments depend on a template parameter, declaration of * must 解决
- 论文阅读(2)-Toward Real-Time Pedestrain Detection Based on a Deformable Template Model
- linux编译中error: no arguments depend on a template parameter, declaration of * must 解决
- there are no arguments to 'malloc' that depend on a template parameter, so a declaration of 'malloc'
- A XHTML Template
- A general recursive template
- C++: typename in a template template parameter
- Template /template/pimple/a.ftl not found
- A typedef does
- A Simple Web Page Template Parser And A Template Pool
- Paper Outline and a template
- Template for making a class
- 动态加载JS
- html中的fieldset标签
- [zz] 分析Android 根文件系统启动过程(init守护进程分析)
- 购物车实现的三种机理
- 有关session的知识点
- typedef on a template
- 多重继承
- ultraedit 15.10.0.1026 注册码
- Fiddler工具介绍一
- null 与 undefined 的区别
- ASCII码对照表
- Android模拟器入门
- 对2010支付宝西安最新笔试题的看法(大文件数值读取)..
- 安全沙箱解决方案