I know the X{} is the default initializer from internet, and I still don't know what the X() means what. is it initializer? but why the int value();
is not
ok?
so I want to know what difference is between X() and X{}. thank you!
class X{
public:
void operator()(string str)
{
cout << "calling functor x with parameter" << str << endl;
}
};
int main()
{
X foo;
// foo("hi");
X()("hi"); // I don't know what happen when I see the code
X c = X{}; // this is the default initializer
X a = X(); // but what it is
int value{};
// int value(); // this is error
}