编译时错误之 error C2338: tuple_element index out of bounds
生活随笔
收集整理的這篇文章主要介紹了
编译时错误之 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。
?
(全文完)
轉載于:https://www.cnblogs.com/fengyubo/p/4866623.html
總結
以上是生活随笔為你收集整理的编译时错误之 error C2338: tuple_element index out of bounds的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 药品广告台词28句
- 下一篇: EBS请求查找运行详细信息