关于在vs2013中的一个错误
来源:互联网 发布:淘宝客怎么微信推广 编辑:程序博客网 时间:2024/05/22 06:24
原来的代码是:
<pre name="code" class="cpp">vector<double> vec1(0.1,0.1);vector<double> vec2(0.2,0.2);两句话出现了26个错误:
错误 10 error C2868: “std::iterator_traits<_Iter>::value_type”: 非法的 using 声明语法;应输入限定名 d:\program files\vs\vc\include\xutility 372 1 charlotte
错误 25 error C2868: “std::iterator_traits<_Iter>::reference”: 非法的 using 声明语法;应输入限定名 d:\program files\vs\vc\include\xutility 376 1 charlotte
错误 20 error C2868: “std::iterator_traits<_Iter>::pointer”: 非法的 using 声明语法;应输入限定名 d:\program filess\vc\include\xutility 375 1 charlotte
错误 5 error C2868: “std::iterator_traits<_Iter>::iterator_category”: 非法的 using 声明语法;应输入限定名 d:\program files\vs\vc\include\xutility 371 1 charlotte
错误 15 error C2868: “std::iterator_traits<_Iter>::difference_type”: 非法的 using 声明语法;应输入限定名 d:\program files\vs\vc\include\xutility 373 1 charlotte
错误 1 error C2825: '_Iter': 当后面跟“::”时必须为类或命名空间 d:\program files\vs\vc\include\xutility 371 1 charlotte
错误 6 error C2825: '_Iter': 当后面跟“::”时必须为类或命名空间 d:\program files\vs\vc\include\xutility 372 1 charlotte
错误 11 error C2825: '_Iter': 当后面跟“::”时必须为类或命名空间 d:\program files\vs\vc\include\xutility 373 1 charlotte
错误 16 error C2825: '_Iter': 当后面跟“::”时必须为类或命名空间 d:\program files\vs\vc\include\xutility 375 1 charlotte
错误 21 error C2825: '_Iter': 当后面跟“::”时必须为类或命名空间 d:\program files\vs\vc\include\xutility 376 1 charlotte
错误 26 error C2664: “void std::vector<double,std::allocator<_Ty>>::_Construct<_Iter>(_Iter,_Iter,std::forward_iterator_tag)”: 无法将参数 3 从“double”转换为“std::input_iterator_tag” d:\program files\vs\vc\include\vector 766 1 charlotte
错误 9 error C2602: “std::iterator_traits<_Iter>::value_type”不是“std::iterator_traits<_Iter>”基类的成员 d:\program files\vs\vc\include\xutility 372 1 charlotte
错误 24 error C2602: “std::iterator_traits<_Iter>::reference”不是“std::iterator_traits<_Iter>”基类的成员 d:\program files\vs\vc\include\xutility 376 1 charlotte
错误 19 error C2602: “std::iterator_traits<_Iter>::pointer”不是“std::iterator_traits<_Iter>”基类的成员 d:\program files\vs\vc\include\xutility 375 1 charlotte
错误 4 error C2602: “std::iterator_traits<_Iter>::iterator_category”不是“std::iterator_traits<_Iter>”基类的成员 d:\program files\vs\vc\include\xutility 371 1 charlotte
错误 14 error C2602: “std::iterator_traits<_Iter>::difference_type”不是“std::iterator_traits<_Iter>”基类的成员 d:\program files\vs\vc\include\xutility 373 1 charlotte
错误 8 error C2146: 语法错误: 缺少“;”(在标识符“value_type”的前面) d:\program files\vs\vc\include\xutility 372 1 charlotte
错误 23 error C2146: 语法错误: 缺少“;”(在标识符“reference”的前面) d:\program files\vs\vc\include\xutility 376 1 charlotte
错误 18 error C2146: 语法错误: 缺少“;”(在标识符“pointer”的前面) d:\program files\vs\vc\include\xutility 375 1 charlotte
错误 3 error C2146: 语法错误: 缺少“;”(在标识符“iterator_category”的前面) d:\program files\vs\vc\include\xutility 371 1 charlotte
错误 13 error C2146: 语法错误: 缺少“;”(在标识符“difference_type”的前面) d:\program files\vs\vc\include\xutility 373 1 charlotte
错误 7 error C2039: “value_type”: 不是“`global namespace'”的成员 d:\program files\vs\vc\include\xutility 372 1 charlotte
错误 22 error C2039: “reference”: 不是“`global namespace'”的成员 d:\program files\vs\vc\include\xutility 376 1 charlotte
错误 17 error C2039: “pointer”: 不是“`global namespace'”的成员 d:\program files\vs\vc\include\xutility 375 1 charlotte
错误 2 error C2039: “iterator_category”: 不是“`global namespace'”的成员 d:\program files\vs\vc\include\xutility 371 1 charlotte
错误 12 error C2039: “difference_type”: 不是“`global namespace'”的成员 d:\program files\vs\vc\include\xutility 373 1 charlotte
将代码改为:
vector<double> vec1={0.1,0.1};vector<double> vec2={0.2,0.2};则错误消失。
正确的vector初始化的方法是:
vector<T> v3(a0,a1)不是一种正确的初始化方法,故而出现错误。
- 关于在vs2013中的一个错误
- std::regex在VS2013中的一个坑
- 关于vs2013中的BrowserLink问题
- 关于VS2013中的字体颜色
- 关于libcurl使用中的一个编译错误
- 记录一个关于HQL中的错误
- 关于初学js中的一个低级错误
- pclint在VS2013中的配置
- sonarqube在vs2013中的集成
- OPencv在VS2013中的配置
- ffmpeg在VS2013中的配置
- vs2013 && win7 x64下出现的诡异错误:已在xxx.exe中触发一个断点
- xxxx和xxxx_s在VS2013中错误
- 关于C++VS2013中的安全的问题
- Live555源码在vs2010/vs2013中的编译
- asp.net配置在vs2013中的开启
- opencv2.4.9在vs2013中的配置
- OpenCV2.4.11在VS2013中的props文件
- 栈的基本操作
- Eclipse安装WindowBuilder
- 制作initrd(3):/etc/initramfs-tools/modules配置文件分析
- hdu1005 循环节||矩阵快速幂取模
- HDOJ--4548--美素数
- 关于在vs2013中的一个错误
- Android基础--ConnectivityManager检查网络连接
- 4.5方法参数
- 翻转字符串
- Android篇 ListView 优化笔记
- 软件测试W方法
- cnetos安装vncserver
- 彩色图像的空间域滤波
- ASIDownloadCache 设置下载缓存