简体   繁体   English

KEIL错误:没有重载函数“ std :: transform”的实例与参数列表匹配

[英]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.

相关问题 “没有重载函数“转换”的实例与参数列表匹配”并行执行时出错 - "no instance of overloaded function "transform" matches the argument list" error with parallel execution 错误:没有重载 function “std::getline”实例与参数列表匹配 — 参数类型为:(std::istream, char [50]) - Error: No instance of overloaded function “std::getline” matches the argument list — argument types are: (std::istream, char [50]) 没有重载函数“”的实例与参数列表错误匹配 - no instance of overloaded function “” matches the argument list error std::vector 没有重载 function 的实例与参数列表匹配 - std::vector no instance of overloaded function matches the argument list 错误:没有重载函数“std :: make_shared”的实例与参数列表匹配 - Error: no instance of overloaded function “std::make_shared” matches the argument list 没有重载的 function 实例与参数列表匹配,参数类型为:(std::ifstream, std::string, char) - No instance of overloaded function matches the argument list, argument types are: (std::ifstream, std::string, char) 错误:多个重载函数实例与参数列表匹配 - Error: more than one instance of overloaded function matches argument list 错误没有重载函数的实例“getline”匹配参数列表c ++ - error no instance of overloaded function “getline” matches the argument list c++ 错误:多个重载函数实例与参数列表匹配 - Error: More than one instance of overloaded function matches the argument list 错误没有重载的实例 function “getline” 与参数列表匹配 - Error No instance of overloaded function “getline” matches the argument list
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM