编译时错误之 error C2338: tuple_element index out of bounds
part 1
编译器 vs2015 VC++。
完整的错误信息粘贴如下:
d:\program files (x86)\microsoft visual studio 14.0\vc\include\utility(361): error C2338: tuple_element index out of bounds
在百度上找了一下,没有中文版解释。我觉得今后把C++编译时遇到的错误及解决方法记录下来会很有裨益。
part 2 正文
错误的代码:
auto it1 = find_if(numbers.cbegin(), numbers.cend(), bind(check_size, "feng", placeholders::_2));
错误原因:
auto newCallable = bind(check_size, "feng", placeholders::_2);
错误的使用了 placeholdesr::_2 ,其含义是 newCallable 的第二个参数,是暴露给算法的第二个参数。要知道,newCallable 只有一个参数是暴漏的算法的,还没有第一个呢,直接就有了第二个,编译时错误妥妥的!
如何改正:
auto it1 = find_if(numbers.cbegin(), numbers.cend(), bind(check_size, "feng", placeholders::_1));
把 placeholdesr::_2 改成 placeholdesr::_1。
(全文完)
编译时错误之 error C2338: tuple_element index out of bounds的更多相关文章
- Error: Error setting TTL index on collection : sessions
Error: Error setting TTL index on collection : sessions 一.步骤一: 这个问题一般是直接升级 mongodb和connect-mongo的版本为 ...
- error C2338: You've instantiated std::aligned_storage<Len, Align> with an extended alignment (in other words, Align >
报的完整错误为: error C2338: You've instantiated std::aligned_storage<Len, Align> with an extended al ...
- Qt5.编译错误.error: C2338: The slot requires more arguments than the signal provides.
1.Qt563x86vs2015,遇到如下 编译错误: error: C2338: The slot requires more arguments than the signal provides. ...
- atlcomcli.h(1756): error C2338: CVarTypeInfo< char > cannot be compiled with /J or _CHAR_UNSIGNED fl
我拿到一个VS的工程,用VS2010 编译 时提示: atlcomcli.h(1756): error C2338: CVarTypeInfo< char > cannot be comp ...
- 报错:[__NSArrayI objectAtIndex:]: index 5 beyond bounds [0 .. 4]'
报错内容:如下 分析: 遇到这种情况,说明超出了数组的范围 如要插入某组数据,但是这组数据只有10条:但是这里设置为20条.当第11个cell填充数据时就会报错, [__NSArrayI object ...
- [_UICascadingTextStorage attributesAtIndex:effectiveRange:]: Range or index out of bounds
之前写过一篇<如何更好地限制一个UITextField的输入长度>,在文章最后得到的结论是可以直接使用 UIKIT_EXTERN NSString *const UITextFieldTe ...
- ERROR 1709 (HY000): Index column size too large. The maximum column size is 767 bytes.
MySQL版本5.6.35 在一个长度为512字符的字段上创建unique key报错 CREATE DATABASE dpcs_metadata DEFAULT CHARACTER SET utf8 ...
- 关于Springboot+thymeleaf +MybatisPlus 报错Error resolving template [index], template might not exist的问题解决
这个问题困扰了我整整一上午,各种方式,什么返回路径 ,静态资源啊 什么的,能想到的都去搞了,可是问题还是解决不了!!!我查看了一下编译文件的[target]文件夹!发现了问题所在!根本就没有编译进去! ...
- error: open(".vs/ConsoleApp349/v16/Server/sqlite3/db.lock"): Permission denied error: unable to index file
第一种1.git add --ignore-errors . 特别注意 git add --ignore-errors . errors后面有一个空格再加一个点' .' 第二种: 1.touch .g ...
随机推荐
- python 结巴分词(jieba)详解
文章转载:http://blog.csdn.net/xiaoxiangzi222/article/details/53483931 jieba “结巴”中文分词:做最好的 Python 中文分词组件 ...
- EF 性能调优
--EF 批量增删改 http://www.cnblogs.com/lori/archive/2013/01/31/2887396.html http://www.cnblogs.com/gzalrj ...
- USB--- kvm in ubuntu:
USB SS=USB SuperSpeed=USB 3.0!!顺应此前的USB 1.1 FullSpeed和USB 2.0 HighSpeed https://jingyan.baidu.com/ar ...
- MongoDB的数据恢复
当MongoDB正在插入或更新数据时,若突然出现断电或者不可逆转的摧毁性事件发生时,MongoDB没有像oracle或sql server这种关系型数据库提供事物机制,所以会产生垃圾数据.但Mongo ...
- Subsequence---poj3061(尺取法||二分)
题目链接:http://poj.org/problem?id=3061 题意:给n个正整数和一个数S,求出总和不小于S的连续子序列的长度的最小值,如果无解输出0: 我们可以用sum[i]表示前i项的和 ...
- android studio 自定义控件
第一种方式: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:andro ...
- Linux Packages Search
网站 : https://www.pkgs.org/ https://centos.pkgs.org/
- 【剑指offer】替换空格
一.题目: 请实现一个函数,将一个字符串中的空格替换成“%20”.例如,当字符串为We Are Happy.则经过替换之后的字符串为We%20Are%20Happy. 二.思路: Python代码,先 ...
- orm之路由层
一.简单配置 1.参数 第一个参数是正则表达式(如果要精准匹配:‘^publish/$’),或者加斜杠('^publish/') 第二个参数是视图函数(不要加括号) urlpatterns = [ u ...
- iOS手机应用开发原型模板及开发流程
在开始做一个项目的时候,究竟需要准备些什么前期工作呢,在外包公司中,又是一个怎么样的开发步骤呢?下面,按照我的理解,说一下. 项目流程图 看上图,从左往右,如果我们仅是一名开发工程师,只需要关心上图中 ...