KEIL 错误:没有与参数列表匹配的重载函数"std::transform"实例
KEIL error: no instance of overloaded function "std::transform" matches the argument list
我有一个问题,在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());
}
这就是我得到的
错误:#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++版本cX
,它在::std
命名空间中提供了一些相同的功能。
相关文章:
- 为什么使用SFINAE而不是函数重载
- 为什么我不能在 C++ 中的特定函数重载中调用同一函数的任何其他重载?
- c++:可变模板和函数重载
- 在缺少函数重载时抛出异常,并带有 std::variant 而不是编译时错误
- 解决模板成员函数重载
- 为什么不允许成员函数和非成员函数之间的函数重载?
- 推断模板化函数中的函数重载
- C++复制函数重载导致"must be a nonstatic member function"错误
- 为什么 std::sort 找不到合适的(静态成员)函数重载?
- 可变参数泛型 lambda 和函数重载
- C++中的函数重载和继承
- 当有右值构造函数可用时,为什么从右值调用类引用构造函数重载?
- C/C++ 可变参数宏函数重载
- 将基类的成员函数重载到其他派生类C++
- C++ 函数重载匹配
- C++函数重载,具体步骤是什么
- C++:使用 param pack 显式调用函数重载
- 隐式生成的函数重载用于右值参数?
- 使用函数重载输入运算符
- 运算符重载函数上的函数重载