|
From: James W. W. <os...@jw...> - 2005-01-18 01:34:39
|
On Jan 17, 2005, at 3:19 PM, Jose' Cruanyes wrote: > the error is C2552 > > from the VC 6.0 manual > ------------------ > Compiler Error C2552 > > 'identifier' : non-aggregates cannot be initialized with initializer=20= > list > > The specified identifier was incorrectly initialized. > > An initializer list is needed to initialize the following types: > =95 An array > > =95 A class, structure, or union that does not have = constructors,=20 > private or protected members, base classes, or virtual functions > > These types are known as =93aggregates.=94 > ------------------ > > with these criteria the error is legitimate since the CQ3ObjectRef has=20= > a constructor > now the question is 'are these criteria legitimate?' In the original code, it was the TOCEntry structure, not its=20 CQ3ObjectRef member, that was being initialized with an initializer=20 list. The TOCEntry structure is an aggregate, being a structure that=20 does not have constructors, private or protected members, base classes,=20= or virtual functions. Therefore, the text you quote here does not=20 explain why one should not be able to initialize TOCEntry with an=20 initializer list. I've heard that VC++ 7 is much more standards-compliant. I wonder why=20= you don't upgrade? Is it a matter of cost, or are you in a situation=20 where it is considered too risky to change compilers? -- <http://www.jwwalker.com/> |