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 ...
随机推荐
- keras入门--Mnist手写体识别
介绍如何使用keras搭建一个多层感知机实现手写体识别及搭建一个神经网络最小的必备知识 import keras # 导入keras dir(keras) # 查看keras常用的模块 ['Input ...
- SVN 服务器搭建及使用 一
SVN服务器搭建和使用(一) Subversion是优秀的版本控制工具,其具体的的优点和详细介绍,这里就不再多说. 首先来下载和搭建SVN服务器. 现在Subversion已经迁移到apache网站上 ...
- 关闭Spring Boot的Jsckson的FAIL_ON_EMPTY_BEANS
说明:Spring Boot中默认使用了Jackson做JSON的解析. 解决方法: 1.通过注入Bean来实现 错误: org.springframework.http.converter.Http ...
- python中获取当前位置所在的行号和函数名(转)
http://www.vimer.cn/2010/12/%E5%9C%A8python%E4%B8%AD%E8%8E%B7%E5%8F%96%E5%BD%93%E5%89%8D%E4%BD%8D%E7 ...
- javascript(js)自动刷新页面的实现方法总结
自动刷新页面的实现方法总结: 1) <meta http-equiv="refresh"content="10;url=跳转的页面"> 10表示间隔 ...
- Spring工具类ToStringBuilder用法简介
比如说我们需要打印某个方法的User参数对象 package test; /** * * @author zhengtian * @time 2012-6-28 */ public class Use ...
- java 基础数据结构源码详解及数据结构算法
http://www.cnblogs.com/skywang12345/category/455711.html http://www.cnblogs.com/liqiu/p/3302607.html
- Jquery UI 中Tree组件的json格式,java递归拼接demo
数据库中表数据,如下图: 实现的需求是,如果suporgcode数据为null 的情况下,表示在一级节点 "请选择" 的二级节点,然后是如:3和36 是1的子节点,一步一步的节点延 ...
- 多线程间通信之AutoResetEvent和ManualResetEvent的原理分析和开发示例
AutoResetEvent 允许线程通过发信号互相通信. 通常,当线程需要独占访问资源时使用该类. 线程通过调用 AutoResetEvent 上的 WaitOne 来等待信号. 如果 AutoRe ...
- JVM 图形化监控工具
1.jvmstat jvmstat是图形版的jstat,由Java 官方提供,目前最新版本为3.0. 下载地址:http://www.oracle.com/technetwork/jav ...