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的更多相关文章

  1. Error: Error setting TTL index on collection : sessions

    Error: Error setting TTL index on collection : sessions 一.步骤一: 这个问题一般是直接升级 mongodb和connect-mongo的版本为 ...

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

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

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

  5. 报错:[__NSArrayI objectAtIndex:]: index 5 beyond bounds [0 .. 4]'

    报错内容:如下 分析: 遇到这种情况,说明超出了数组的范围 如要插入某组数据,但是这组数据只有10条:但是这里设置为20条.当第11个cell填充数据时就会报错, [__NSArrayI object ...

  6. [_UICascadingTextStorage attributesAtIndex:effectiveRange:]: Range or index out of bounds

    之前写过一篇<如何更好地限制一个UITextField的输入长度>,在文章最后得到的结论是可以直接使用 UIKIT_EXTERN NSString *const UITextFieldTe ...

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

  8. 关于Springboot+thymeleaf +MybatisPlus 报错Error resolving template [index], template might not exist的问题解决

    这个问题困扰了我整整一上午,各种方式,什么返回路径 ,静态资源啊 什么的,能想到的都去搞了,可是问题还是解决不了!!!我查看了一下编译文件的[target]文件夹!发现了问题所在!根本就没有编译进去! ...

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

随机推荐

  1. @font-face 字体图标的应用

    所谓字体图标,顾名思义就是图标以字体的形式存在,可以利用 font-size.color 对字体图标的大小和颜色进行渲染.将小图标集中放到字体库里,利用css3 @font-face 引用图标,不仅有 ...

  2. dbAdmin 不等于 root 集合中角色

    dbAdmin  root  集合中角色 use admin创建 db.createUser( { user: "tmp_rw_56756", pwd: "tmp4242 ...

  3. TP5.0 controller下分版本 分块 分目录写法访问

    这个写法是在api模块下的controller目录下又分出了v1和以后未知的v(x)版本,这个时候需要配置路由来访问这个接口类似于这种形式: http://www.xx.com/index.php/a ...

  4. 解决下载的CHM文件无法显示网页问题

    问题症状:打开CHM文件,左边目录齐全,可右边边框里却是无法显示网页. 解决方法:方法一:修改注册表1)新建一个文本文件2)添加如下内容:REGEDIT4[HKEY_LOCAL_MACHINE\SOF ...

  5. MySQL找出锁等待

    1.服务器级别的锁等待 可以通过show processlist看到等待锁的线程id,但是无法知道究竟哪个线程持有锁 可以通过mysqladmin debug 相关等待锁的线程以及谁持有锁可以在错误日 ...

  6. android指纹

    Android 6.0+指纹识别心得 Android 6.0+Fingerprint心得 数据来源:https://blog.csdn.net/lhj1076880929/article/detail ...

  7. C++(STL)&&树-堆结构练习——合并果子之哈夫曼树

    题目题解:http://blog.csdn.net/xu12110501127/article/details/9199335 有关博客:http://www.360doc.com/content/1 ...

  8. PAT Radix[二分][进制转换][难]

    1010 Radix (25)(25 分) Given a pair of positive integers, for example, 6 and 110, can this equation 6 ...

  9. LeetCode--53 最大连续子序列(总结)

    # 给定一个整数数组 nums ,找到一个具有最大和的连续子数组(子数组最少包含一个元素),返回其最大和. # 示例:# 输入: [-2,1,-3,4,-1,2,1,-5,4],# 输出: 6# 解释 ...

  10. Keras 源码分析

    . │ activations.py │ callbacks.py │ constraints.py │ initializations.py │ metrics.py │ models.py │ o ...