no matching function for call to 'make_pair(std::string&, size_t&)'
rtl->push_back(make_pair<string, int>(str, pos));
在redhat6上编译无问题,在centos7上编译出现错误:
no matching function for call to 'make_pair(std::string&, size_t&)'
,这是由于
定义于头文件 <utility>
template< class T1, class T2 >
std::pair<T1,T2> make_pair( T1 t, T2 u );//(C++11 前)
template< class T1, class T2 >
std::pair<V1,V2> make_pair( T1&& t, T2&& u );//(C++11 起)-(C++14 前)
template< class T1, class T2 >
constexpr std::pair<V1,V2> make_pair( T1&& t, T2&& u );//(C++14 起)
make_pair在c++11前后修改了声明,对于该错误,有两种修改方式:
1、make_pair(str, pos)
2、make_pair<string, int>(string(str), int(pos))
no matching function for call to 'make_pair(std::string&, size_t&)'的更多相关文章
- error: no matching function for call to 'std::exception:exception(const char[16])'
环境:codeblocks 语言:C++ 在执行:throw new exception("queue is empty.");时 遇到问题:error: no matching ...
- 【ERROR】no matching function for call to 'std::basic_ifstream<char>::basic_ifstream
错误记录:QT中使用 no matching function for call to 'std::basic_ifstream<char>::basic_ifstream(QString ...
- Error no matching function for call to 'std::exception::exception(const char [15])'
Error no matching function for call to 'std::exception::exception(const char [15])' Error 'logic_err ...
- g2o相关问题cs.h,以及no matching function for call to ‘g2o::OptimizationAlgorithmLevenberg::OptimizationAlgorithmLevenberg(Block*&)
1.对于cs.h找不到的情况 1)编译的时候一定要把csparse在EXTERNAL文件中,编译进去. 2)修改CMakeLists.txt文件中的include_directories中的${CPA ...
- boost::bind 不能处理函数重载 (error: no matching function for call to 'bind')
前言 最近任务多.工期紧,没有时间更新博客,就水一期吧.虽然是水,也不能太失水准,刚好最近工作中遇到一个 boost::bind 的问题,花费了半天时间来定位解决,就说说它吧. 问题背景 项目中使用了 ...
- C++异常:no matching function for call to "Matrix(Matrix&)"
C++异常:no matching function for call to "Matrix(Matrix&)" 我定义了一个类叫Matrix,其中构造函数explicit ...
- Qt error ------ no matching function for call to QObject::connect(QSpinBox*&, <unresolved overloaded function type>, QSlider*&, void (QAbstractSlider::*)(int))
connect(ui->spinBox_luminosity,&QSpinBox::valueChanged, ui->horizontalSlider_luminosity, & ...
- C++ std::unordered_map使用std::string和char *作key对比
最近在给自己的服务器框架加上统计信息,其中一项就是统计创建的对象数,以及当前还存在的对象数,那么自然以对象名字作key.但写着写着,忽然纠结是用std::string还是const char *作ke ...
- could not deduce template argument for 'const std::_Tree<_Traits> &' from 'const std::string'
VS2008, 写一个简单的demo的时候出现了这个: 1>------ Build started: Project: GetExportTable, Configuration: Relea ...
随机推荐
- 压测工具Siege
一.下载 http://www.joedog.org/ http://www.joedog.org/pub/siege/siege-2.70.tar.gz 二.测试 siege -c200 -r10 ...
- 【BZOJ】3697: 采药人的路径
3697: 采药人的路径 Time Limit: 10 Sec Memory Limit: 128 MBSubmit: 1718 Solved: 602[Submit][Status][Discu ...
- bzoj 2038 小Z的袜子 莫队算法
题意 给你一个长度序列,有多组询问,每次询问(l,r)任选两个数相同的概率.n <= 50000,数小于等于n. 莫队算法裸题. 莫队算法:将序列分为根号n段,将询问排序,以L所在的块为第一关键 ...
- js异步处理工作机制(setTimeout, setInterval)
经常谈到异步,但是发现自己一直没深入理解setTimeout, setInterval,逛论坛的时候发现了这篇好文章,分享一下. ————————————————————以下为原文—————————— ...
- [转]Android x86模拟器Intel Atom x86 System Image配置与使用方法
Android x86模拟器Intel Atom x86 System Image配置与使用方法 前言: 大家现在开发使用的Android 模拟器模拟的是 ARM 的体系结构(arm-eabi),因此 ...
- HTML导出Excel数据类型转换样式参考
mso-number-format:"0" NO Decimals mso-number-format:"0/.000" 3 Decimals mso-numb ...
- CentOS 6.9下的iptables在本机用DNAT转发指定IP到内网IP无效的问题解决(127.0.0.1)
比如: iptables -t nat -A OUTPUT -p tcp -d 192.168.1.0/24 --dport 2222 -j DNAT --to-destination 127.0.0 ...
- Swift使用NSKeyedArchiver进行数据持久化保存的经验
iOS提供了几种数据持久化保存的方法,有NSKeyedArchiver,Property List,NSUserDefaults和CoreData.我学习下来,觉得保存应用内的诸如列表,记录这些东西, ...
- mysql 实验
http://yangyaru0108.blog.51cto.com/6616699/1205001
- visual studio xcopy /exclude测试
http://files.cnblogs.com/files/zfanlong1314/exclude%E6%B5%8B%E8%AF%95.zipxcopy 提供了 /EXCLUDE: 参数用于在复制 ...