"term does not evaluate to a function taking 0 arguments"错误
"term does not evaluate to a function taking 0 arguments" error
template <typename T>
class Sorteermethode {
public:
virtual void operator()(vector<T> & v) const = 0;
void meet(int kortste, int langste, ostream& os) {
Sortvector<T> * mijnVector = new Sortvector<T>(kortste);
Chrono * chrono = new Chrono;
while (kortste <= langste) {
(*mijnVector).vul_range();
(*chrono).start();
this()(*mijnVector);
(*chrono).stop();
printf("Lengte: %d tijd: %f", kortste, (*chrono).tijd());
kortste *= 10;
(*mijnVector).resize(kortste);
}
free(chrono);
free(mijnVector);
};
};
当我尝试调用先前定义的运算符 () 时,出现以下错误:
Severity Code Description Project File Line
Error C2064 term does not evaluate to a function taking 0 arguments Algoritmen1 c:usersuserdocumentsvisual studio 2015projectsalgoritmen1algoritmen1sorteermethode.h 40
谁能给我一些见解?据我所知,它没有解析为带有一个参数的函数。
这个:
this()(*mijnVector);
正在尝试调用this
指针。你想要调用它指向的对象。正确的语法是:
(*this)(*mijnVector);
或者,如果你觉得特别罗嗦:
this->operator()(*mijnVector);
相关文章:
- 具有变量Number of Arguments的std::函数的矢量
- 如何修复"too few arguments to function"?
- 开放CV垫"Sizes of input arguments do not match"的问题
- 隐式转换产生"error: taking address of temporary"(GCC 与 clang)
- 有没有办法在初始化字符串时避免来自 clang-tidy(fuchsia-default-arguments)的警告?
- glGenVertexArrays and glGenBuffers arguments
- 'type_alias<char[N]>{}' VS 'char[N]{}' in function's arguments
- Command Line Arguments wxCmdLineArgsArray in wxWidgets
- OpenCV std::vector for cv::Mat arguments
- map.insert:"Invalid arguments"错误与 pair<enum,vector<*>>
- VS说"Too few arguments...",但其他编译器给了我正确的输出?
- Win32 CreateThread() Arguments Zero'ed?
- 当"taking address of temporary"错误妨碍干净的代码时
- Eclipse CDT - 使用模板默认值时的"Invalid arguments"
- "All arguments to functions are passed by value" C 中的,C++ 中对引用传递的混淆
- std::result_of for lvalue/rvalue arguments
- RPC:xdr_bytes "Can't encode arguments"当阵列太大时
- 是“ Gnu-Zero-variadic-Macro-arguments”可靠地忽略
- "term does not evaluate to a function taking 0 arguments"错误
- 标准::平等给出"Term doesnt evaluate to a function taking 2 arguments"