Why strange behaviour with operator()? [duplicate]
问题 This question already has answers here : My attempt at value initialization is interpreted as a function declaration, and why doesn't A a(()); solve it? (5 answers) Closed 4 years ago . I have simple class, class Func { public: Func() { cout<<"Constructor"<<endl; } int operator()(int) { cout<<"Operator ()"; return 0; } }; When I create it's object by giving parenthesis, Func f(); , it prints nothing, it should print Constructor . But when I create object without parenthesis it prints