0

My code is as follows:

class Foo{
    public:
    int operator()(int i)
    {
        return 1;
    }

    int operator++(int i)
    {
        return 1;
    }
};

int main()
{
    Foo foo;
    int a = foo++;
    int b = foo(0);
    float c = 0;
}

The problem is that I am not able to watch foo(0):

enter image description here

foo++ is visible normally.

I think the reason is that overloaded function call operator becomes a FunctionObject type (see here https://en.cppreference.com/w/cpp/language/operators).

Is it possible to watch it?

rioV8
  • 24,506
  • 3
  • 32
  • 49
Andrey
  • 5,932
  • 3
  • 17
  • 35

1 Answers1

0

As n-1-8e9-wheres-my-share-m commented, foo.operator()(0) works for me:

enter image description here

ramsay
  • 3,197
  • 2
  • 14
  • 13