C++ KEIL错误:没有重载函数的实例;std::transform“;匹配参数列表
我有一个问题,在XCode中没有重新出现(甚至没有警告),但允许我在Keil MDK中编译C++ KEIL错误:没有重载函数的实例;std::transform“;匹配参数列表,c++,compiler-errors,arm,keil,C++,Compiler Errors,Arm,Keil,我有一个问题,在XCode中没有重新出现(甚至没有警告),但允许我在Keil MDK中编译 void grammar::parse(std::string &_expr) { std::transform(_expr.begin(), _expr.end(), _expr.begin(), std::tolower); _expr.erase(std::remove_if(_expr.begin(), _expr.end(), std::isspace), _expr.e
void grammar::parse(std::string &_expr) {
std::transform(_expr.begin(), _expr.end(), _expr.begin(), std::tolower);
_expr.erase(std::remove_if(_expr.begin(), _expr.end(), std::isspace), _expr.end());
}
这就是我得到的
错误:#304:重载函数“std::transform”的实例与参数列表不匹配
错误:#304:函数模板“std::remove_if”的实例与参数列表不匹配
标题包括:
#include <iostream>
#include <sstream>
#include <iomanip>
#include <cmath>
#include <stdlib.h>
#include <math.h>
#include <ctype.h>
#include <stdio.h>
#include <algorithm>
#包括
#包括
#包括
#包括
#包括
#包括
#包括
#包括
#包括
你能告诉我去哪里找吗?我很惊讶XCode版本能像预期的那样工作…您包括
ctype.h
,该头在全局名称空间中声明了一个函数tolower
(这是C库的一部分,因此没有其他名称空间)。也许你想包括cctype
。对于给定的C标准库头<代码> x.h < /C>,有一个C++版本iostream
和潜在的其他标准头间接地)locale
头。在该头文件中有一些std::tolower
的重载,编译器可能无法确定要使用哪个。如果是这种情况,您可以通过强制转换(真正选择重载):static\u cast(std::tolower)