dependent scope
来源:互联网 发布:象棋残局软件 编辑:程序博客网 时间:2024/04/30 19:15
最近写的一段C++代码在visual studio 2008下编译通过,但是用gcc报出一大堆错误,最显眼的提示就是dependent scope,经过一番百度发现是我学艺不精,这是C++基础问题,“在你涉及到一个在 template(模板)中的 nested dependent type name(嵌套依赖类型名)的任何时候,你必须把单词 typename 放在紧挨着它的前面”(有两个例外)。但是在VS2008里对于这个不是非常敏感,例如
template <class T>class A{ vector<T>::iterator ite;};
VS2008会默认vector<T>::iterator为类型名,顺利通过编译,但是gcc会出错。
用VS2008学C++的同学还是换成其他编译器吧,vs的确很强大很好用,但是在有些地方会误导初学者
上个链接给大家
http://www.cnblogs.com/abiao/articles/1259823.html (C++关键字typename)
- dependent scope
- typename "dependent scope"
- 编译错误need 'typename' before *** because *** is a dependent scope 浅析
- resources dependent
- Dependent Check
- scope
- Scope
- scope
- scope
- scope
- nested dependent type names
- Platform Dependent Compilation
- DEPENDENT SUBQUERY标记
- Platform Dependent Compilation
- Item 25. Argument Dependent Lookup
- Custom role-dependent user profiles
- Can't find dependent libraries
- Argument Dependent Lookup (ADL)解析
- vi/vim编辑器必知必会
- 有用的Web或者手机UI设计工具
- union
- IM 开源项目 登录服务器 <1>
- Ejabberd MUC的配置
- dependent scope
- 收起浮躁
- android启动认识
- Android成长之路-HelloWorld项目详解
- mysql问题以及解决方法
- Linux下删除大量文件error : bash: /bin/rm: Argument list too long
- Cisco Packet Tracer12…………不同的配置模式
- libpcap函数库详细介绍
- 加速PHP的echo