weihuayi的个人博客分享 http://blog.sciencenet.cn/u/weihuayi

博文

typename and typedef

已有 2207 次阅读 2010-9-6 09:44 |个人分类: C++|系统分类:科研笔记|关键词:学者| typename, typedef

typedef

用来定义一个类型的别名。


Things to remeber

在声明 template parameters(模板参数)时,class 和 typename 是可互换的

用 typename 去标识 nested dependent type names(嵌套依赖类型名),在 base class lists(基类列表)中或在一个 member initialization list(成员初始化列表)中作为一个 base class identifier(基类标识符)时除外。

https://m.sciencenet.cn/blog-284809-359811.html

上一篇: Trait Class
下一篇:一个数学问题

0

发表评论 评论 (0 个评论)

数据加载中...

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-6-18 01:38

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部