编译时错误之 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 ...
随机推荐
- Pandas新建一个DataFrame
我们在使用Pandas时候,前提需要一个新的DataFrame,需要首先初始化一个: 那么可以根据字典形式初始化: # 新建一个dataFrame df = pd.DataFrame({']) 必须包 ...
- POJ - 1191 棋盘分割 记忆递归 搜索dp+数学
http://poj.org/problem?id=1191 题意:中文题. 题解: 1.关于切割的模拟,用递归 有这样的递归方程(dp方程):f(n,棋盘)=f(n-1,待割的棋盘)+f(1,割下的 ...
- free 释放内存
http://www.cplusplus.com/reference/cstdlib/free/ free void free (void* ptr); Deallocate memory block ...
- 从url到请求 再到页面生成
百度面试 从url到请求 再到页面生成 - MartinDing - 博客园 https://www.cnblogs.com/martinding/p/7458723.html
- yum provides "*/nmcli" and apt-get
一般来说著名的linux系统基本上分两大类: 1.RedHat系列:Redhat.Centos.Fedora等 2.Debian系列:Debian.Ubuntu等 RedHat 系列 1 常见的安装包 ...
- SVN版本控制系统搭建(结合http服务)
SVN版本控制服务器搭建 Svn(subversion)是一个开源代码管理的控制系统,用来管理和存储开发的源代码,基于C/S模式.可以单独提供服务,也可以结合http服务来实现. 运行方式 运行端口 ...
- mysql 表基本增删查改
对表的操作是在某个数据库下才能进行的,所以要先选择数据库 "use 数据库名;" 1.创建数据表 1)"create table 表名 (字段1 类型 [约束], ...
- 帝国cms调用缩略图和具体文章的方法
我们在用帝国cms建站的时候经常会在首页或者分类页等调用一些文章,如果文章带有展示图也把图片调用出来.帝国cms调用缩略图和具体文章怎么操作呢?我们用帝国cms的灵动标签[e:loop],只要记住常用 ...
- NYOJ 587 blockhouses 【DFS】
blockhouses 时间限制:1000 ms | 内存限制:65535 KB 难度:3 描写叙述 Suppose that we have a square city with straigh ...
- 扩展的friend语法
Java中没有定义friend. friend用于声明类的友元,可以无视类中成员的属性.无论成员3p中的哪一种,友元类或友元函数都可以访问,破坏了封装性,此关键字备受争议.专家会建议程序员使用get/ ...