Operator() problem

I have a class with operator()(int). I found, that ROOT CINT does not understand properly following code:

class foo {
public:
foo& operator()(int n) { return *this; }
int x;
};

void test() {
foo f;
f.x = 10;
cout << "direct " << f.x << endl; // OK
cout << "level 1 " << f(1).x << endl; // also OK
cout << "level 3 " << f(1)(2)(3).x << endl; // error
}

CINT gives following error message:

Error: class,struct,union or type 2 not defined FILE:test.cxx LINE:20
Error: non class,struct,union object f(1)(2)(3) used with . or -> FILE:test.cxx LINE:20
level 3 (class G__CINT_ENDL)141548360
*** Interpreter error recovered ***

Same compiled code work perfectly.

P.S. I use ROOT version 3.05/02 on Debian.

Hi,

This problem has been fixed in CINT 5.15.102.
So you’ll need ROOT v3_10_01 or higher.

Cheers,
Philippe

Thanks, it’s realy working.