Differences in struct size in VS .NET 2003
Yes, this is a bug that was introduced in VC++ 2003 (aka 7.1). It's
misreading the declaration of STRUCT1::bob -- this becomes obvious from
the type mismatch error message you get when you insert lines that assign
from a STRUCT1::bob to a STRUCT2::bob.
The workaround is to declare fred and bob on separate lines, as in
STRUCT2. This bug has been fixed in the code base for the next version,
but I don't know when the fix will appear in a service pack for the
current version.
Herb
---
Herb Sutter (http://www.gotw.ca)
Convener, ISO WG21 (C++ standards committee) (http://www.gotw.ca/iso)
Contributing editor, C/C++ Users Journal (http://www.gotw.ca/cuj)
Visual C++ program manager, Microsoft (http://www.gotw.ca/microsoft)
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
|