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 ...
随机推荐
- sort大法好———自定义的注意事项!!!!!!
众所周知,在c++中,sort是一个非常好用的排序函数,方便使用.可自定义的特性,让众多oier如我不能自拔.但是在自定义时也有一些大坑需要注意(敲黑板),下面就是oi入门的第不知道多少课,大家认真听 ...
- loj117 有源汇有上下界最小流
link 题意&题解 code: #include<bits/stdc++.h> #define rep(i,x,y) for (int i=(x);i<=(y);i++) ...
- MySQL启动项提权
关于MySQL的启动项提权,听其名知其意.就是将一段 VBS脚本导入到 C:\Documents and Settings\All Users\「开始」菜单\程序\启动 下,如果管理员重启了服务器, ...
- Linux下Apache2.2和PHP5的安装配置
Linux下Apache2.2和PHP5的安装配置 环境介绍 我安装使用的Linux版本为CentOS6.5最精简版,Apache为2.2.29,PHP版本为5.4.28. 系统安装 首先安装Cent ...
- php操作redis出现不报错就退出
金乐园项目 php操作redis出现不报错就退出 死活找不出原因是因为下面这句话导致: 原因igbinary扩展没有装上 $options[\Redis::OPT_SERIALIZER] = ...
- CodeM资格赛5
早上起床太晚,最后没时间了.. 不是ac代码,下次题目在oj上线的时候再去做一下.. #include<iostream> #include<cstdio> #include& ...
- css选择器:first-child和nth-child 采坑记
今天想用nth-child来给一个类似于树的目录(bootstrap-nav-tree 一个angularjs插件)设置不同的颜色,结构大致类似于 <ul> <li class=& ...
- NFC TI TRF7970A Breakout Board for BusPirate or other HW
http://dangerousprototypes.com/forum/viewtopic.php?f=19&t=3187 Just a news about a new Hardware ...
- Maven编译代码的相关命令
第一.main目录下的主代码编写完毕后,使用Maven进行编译,在项目根目录下运行命令mvn clean compile进 行项目编译. 第二.test目录下的测试用例编写完毕之后就可以调 ...
- JSON数据转换到POCO的代码
转载:http://www.cnblogs.com/wintersun/archive/2012/09/14/2684708.html 在Visual Studio 2012中轻松把JSON数据转换到 ...