dependent-name ‘xxx::yyy’ is parsed as a non-type, but instantiation yields a type
简言之,就是说你该用typename的地方没用typename,如以下代码
template<class Cont> void frontInsertion(Cont& ci) {
copy(a, a + sizeof(a)/sizeof(Cont::value_type),
front_inserter(ci));
copy(ci.begin(), ci.end(),
ostream_iterator<typename Cont::value_type>(
cout, " "));
cout << endl;
}
报错:
error: dependent-name ‘Cont:: value_type’ is parsed as a non-type, but instantiation yields a type
note: say ‘typename Cont:: value_type’ if a type is meant
解决办法:
在第2行的Cont::value_type改为typename Cont::value_type即可
备注:
上面的代码用MS VisualStudio自带的编译器编译不会报错,但是GCC会报错。
dependent-name ‘xxx::yyy’ is parsed as a non-type, but instantiation yields a type的更多相关文章
- java.io.FileNotFoundException: D:\xxx\yyy (拒绝访问。)问题
File file=new File(fileAllName); FileWriter fw=new FileWriter(file); 在Java的 FileWriter 方法时 系统抛出了异常 j ...
- wget https://github.com/xxx/yyy/archive/${commit_hash}.zip
wget https://github.com/xxx/yyy/archive/${commit_hash}.zip
- Struts2中DMI(动态方法调用)的错误问题(There is no Action mapped for namespace [/xxx] and action name [xxx!yyy] a)
默认的Struts.xml中是这样的 <constant name="struts.enable.DynamicMethodInvocation" value="f ...
- IDEA下载依赖时提示 resolving dependencies of xxx, yyy
IDEA下载依赖时提示 resolving dependencies of xxx, yyy ,卡住不动 使用Maven命令可以更清楚地分析问题,在IDEA命令行窗口执行mvn compile命令,提 ...
- Spring Cloud Edgware SR3 让Zuul支持形如 /xxx和/xxx/yyy 格式的路径配置
在包路径:org.springframework.cloud.netflix.zuul.filters 下,新建类SimpleRouteLocator,取代jar包中的类.内容如下: /* * Cop ...
- Could not find class XXX referenced from method XXX.<YYY>
Since some ADT-Version you have to set which libraries / projects should be exported too. Project-Pr ...
- [已解决问题] Could not find class XXX referenced from method XXX.<YYY>
导入Jar包的问题,有时候即使引入了Jar包也会报错,比如我在引入了libsvm.jar后仍然会报此错 解决方法是: Step 1. 创建User library,随便命一个名,然后把Jar包导入 S ...
- git pull出现fatal: unable to access 'https://github.com/XXX/YYY.git'
用cmd 发现ping不同 github.com Ping不通,这时候,只需要在host文件里做些修改就可以,首先,定位到路径 C:\Windows\System32\drivers\etc 找到ho ...
- Spring3之MVC
模式-视图-控制器(MVC)是UI设计中常见的设计模式, 该模式区分应用程序中的模式.视图和控制器三个角色,消除了业务逻辑与UI的耦合.模式负责封装视图展示的应用数据.视图应该只显示数据,不包含任何业 ...
随机推荐
- 深入理解java虚拟机笔记之一
Java的技术体系主要有支撑java程序运行的虚拟机,提供各开发领域接口支持Java API,java编程语言及许多第三方java框架( 如Spring,Structs等)构成. 可以把Java程序设 ...
- 【转】svn 的开发目录结构和流程
原文: https://blog.csdn.net/iteye_15570/article/details/82548132 ------------------------------------- ...
- 一篇文章让你读懂Pivotal的GemFire家族产品
一篇文章让你读懂Pivotal的GemFire家族产品 学习了:https://www.sohu.com/a/217157517_747818
- [NPM] Avoid Duplicate Commands by Calling one NPM Script from Another
We can get a lot of utility through CLI tools invoked via npm scripts. Many of these tools have APIs ...
- Visual Studio 2013 Update2
下载: http://download.microsoft.com/download/6/7/8/6783FB22-F77D-45C5-B989-090ED3E49C7C/vs2013.2.iso
- Android 自己主动化測试(3)<monkeyrunner> 依据ID查找对象&touch&type (python)
我在之前的两篇文章中用java来实现过 Android 自己主动化測试(1)怎样安装和卸载一个应用(java).Android 自己主动化測试(2)依据ID查找对象(java). 可是本质上都是用mo ...
- angularjs中ng-repeat的使用
第一个例子:使用ng-repeat最简单的例子 <html ng-app="myApp"> <head> <title>angularjs-de ...
- vue - 子路由-路由嵌套
描述:子路由,也叫路由嵌套,采用在children后跟路由数组来实现,数组里和其他配置路由基本相同,需要配置path和component,然后在相应部分添加<router-view/>来展 ...
- Unity3D随意截图并保存
http://blog.csdn.net/awnuxcvbn/article/details/9199245 效果 代码 <pre name="code" class=&qu ...
- 查看慢sql语句
查看慢sql语句 st.text AS SQL_Full --父级完整语句 ,) , ((CASE statement_end_offset THEN DATALENGTH(st.text) ELSE ...