(); this->operat-6ren">
gpt4 book ai didi

c++ - 如何在 "this"上调用 operator() ?

转载 作者:行者123 更新时间:2023-12-01 13:51:14 25 4
gpt4 key购买 nike

我有一个成员函数需要在类实例 (this) 上调用 operator(),我无法猜测正确的语法。
我试过

  this();
*this();
this->();
this->operator();

和其他一些事情,但错误消息的信息量不是很大,所以我不知道我做错了什么。

我在 SE 上找到的最接近的: How do I call a templatized operator()()?

最佳答案

(*this)(/*parameters*/)
可能是最清楚的方法。

关于c++ - 如何在 "this"上调用 operator() ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58956073/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com