用无参构造结构体对象后无法调用结构体函数?
声明以下结构体:
struct Foo{ Foo(int){} Foo(){} void fun(){}};Foo a(10); a.fun(); Foo b(); b.fun();//error: request for member ‘fun’ in ‘b’, which is of non-class type ‘Foo ()()’
Foo a(10); a.fun(); Foo b; b.fun();
Foo b();