Here's a strange one that got me foxed for a while - only happens on VC6. OK on VC2003 and gcc. I don't really know whether it is legal to initialize a class as POD or not.
Comes up with error C2552: 'll' : non-aggregates cannot be initialized with initializer list
To fix it, comment out private.
Code:
class Legal
{
public:
int tom;
int dick;
int harry;
private:
void DoSomething ();
};
Legal ll = { 1, 2, 3 };
int main ()
{
return 0;
}
To fix it, comment out private.