[英]KEIL error: no instance of overloaded function “std::transform” matches the argument list
I have a problem that does no resurface (even no warnings) in XCode but does allow me to compile in Keil MDK. 我有一个问题,该问题在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.end());
}
That is what I get 那就是我得到的
error: #304: no instance of overloaded function "std::transform" matches the argument list error: #304: no instance of function template "std::remove_if" matches the argument list 错误:#304:没有重载函数“ std :: transform”的实例与参数列表匹配错误:#304:没有函数模板“ std :: remove_if”的实例与参数列表匹配
Header included: 标头包括:
#include <iostream>
#include <sstream>
#include <iomanip>
#include <cmath>
#include <stdlib.h>
#include <math.h>
#include <ctype.h>
#include <stdio.h>
#include <algorithm>
Could you please advise me on where to look? 您能给我建议去哪里看看吗? I am surprised that XCode version works as expected...
我很惊讶XCode版本能按预期运行...
You include ctype.h
, that header declares a function tolower
in the global namespace (this is part of the C library, so there are no other namespaces there). 您包括
ctype.h
,该标头在全局名称空间中声明一个更tolower
的函数(这是C库的一部分,因此那里没有其他名称空间)。 Maybe you meant to include cctype
. 也许您打算包括
cctype
。 For a given C standard library header Xh
, there is a c++ version cX
that provides some of the same functionality inside the ::std
namespace. 对于给定的C标准库标头
Xh
,有一个c ++版本cX
在::std
名称空间内提供某些相同的功能。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.