简言之,就是说你该用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的更多相关文章

  1. java.io.FileNotFoundException: D:\xxx\yyy (拒绝访问。)问题

    File file=new File(fileAllName); FileWriter fw=new FileWriter(file); 在Java的 FileWriter 方法时 系统抛出了异常 j ...

  2. wget https://github.com/xxx/yyy/archive/${commit_hash}.zip

    wget https://github.com/xxx/yyy/archive/${commit_hash}.zip

  3. 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 ...

  4. IDEA下载依赖时提示 resolving dependencies of xxx, yyy

    IDEA下载依赖时提示 resolving dependencies of xxx, yyy ,卡住不动 使用Maven命令可以更清楚地分析问题,在IDEA命令行窗口执行mvn compile命令,提 ...

  5. Spring Cloud Edgware SR3 让Zuul支持形如 /xxx和/xxx/yyy 格式的路径配置

    在包路径:org.springframework.cloud.netflix.zuul.filters 下,新建类SimpleRouteLocator,取代jar包中的类.内容如下: /* * Cop ...

  6. 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 ...

  7. [已解决问题] Could not find class XXX referenced from method XXX.<YYY>

    导入Jar包的问题,有时候即使引入了Jar包也会报错,比如我在引入了libsvm.jar后仍然会报此错 解决方法是: Step 1. 创建User library,随便命一个名,然后把Jar包导入 S ...

  8. git pull出现fatal: unable to access 'https://github.com/XXX/YYY.git'

    用cmd 发现ping不同 github.com Ping不通,这时候,只需要在host文件里做些修改就可以,首先,定位到路径 C:\Windows\System32\drivers\etc 找到ho ...

  9. Spring3之MVC

    模式-视图-控制器(MVC)是UI设计中常见的设计模式, 该模式区分应用程序中的模式.视图和控制器三个角色,消除了业务逻辑与UI的耦合.模式负责封装视图展示的应用数据.视图应该只显示数据,不包含任何业 ...

随机推荐

  1. Qt 维护工具MaintenanceTool.exe 使用

    QT如何管理组件(解决“要继续此操作,至少需要一个有效且已启用的储存库”问题) 转载2017-10-26 01:48:46 标签:qt QT的组件管理软件并没有在开始菜单或者桌面添加快捷方式(5.9版 ...

  2. php 中array_multisort排序,类似于对数据库中的记录依次按多列进行排序

    array_multisort这个函数还是很有用的. ------------------------------------------------------------------------- ...

  3. Was liberty资料总结

    WebSphere Application Server Liberty Profile Guide for Developers: http://www.redbooks.ibm.com/redbo ...

  4. 在第一段ionic示例的基础上增加底部导航

    demo2.html <!DOCTYPE html> <html ng-app="app"> <head> <meta charset=& ...

  5. 解决iOS Xcode 模拟器键盘不弹出

    1. 选中模拟器,在屏幕上方的菜单中找到Hardware->Keyboard 2. 直接快捷键shift+command+k

  6. QtGui.QGridLayout

    The most universal layout class is the grid layout. This layout divides the space into rows and colu ...

  7. Servlet之生命周期【入门版(刚開始学习的人必看)】

    6,Servlet的解说 6.1Servlet生命周期 ,继承HttpServlet init方法(初始化Servlet)将来能够做一些初始化工作 service方法(处理请求) 一般不须要重写ser ...

  8. MSS & MTU

  9. windows vbs显示桌面命令

      windows vbs显示桌面命令 CreationTime--2018年7月26日11点32分 Author:Marydon Dim shell Set shell = CreateObject ...

  10. 33、深入理解Java的接口和抽象类

    深入理解Java的接口和抽象类 对于面向对象编程来说,抽象是它的一大特征之一.在Java中,可以通过两种形式来体现OOP的抽象:接口和抽象类.这两者有太多相似的地方,又有太多不同的地方.很多人在初学的 ...