为什么甚至编译?
struct UE{
UE(bool a = true) { };
// UE(){}; // if UE took no initial args and called below, gcc will complain.
};
class VA {
protected:
UE ue;
public:
VA();
};
VA::VA()
{
ue = new UE(true); // ???why???
// ue = new UE(); // will complain
}
Run Code Online (Sandbox Code Playgroud)
我尝试使用gcc(GCC)4.6.2.如何使用指针分配结构?