www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - BUG: .sizeof doesn't work with nested structs

reply Chris Lajoie <ctlajoie___remove___this___ ___gmail.com> writes:
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Attached sample program illustrates the problem clearly. everything 
works fine if the nested structs are not named. For example if you 
remove the BAR tag on the first nested struct then .sizeof works fine.

Chris
Jan 27 2006
parent Thomas Kuehne <thomas-dloop kuehne.cn> writes:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Chris Lajoie schrieb am 2006-01-27:
 Attached sample program illustrates the problem clearly. everything 
 works fine if the nested structs are not named. For example if you 
 remove the BAR tag on the first nested struct then .sizeof works fine.

No bug. FOO.BAR is a type and thus doesn't require any memory within FOO. try: # struct FOO{ # ... # BAR b; # } Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFD3zWV3w+/yD4P9tIRAmpmAKClUHc2+KcgqZld6Jkv+dkwRyi4ZQCdEygE XXNJ6cCV67T5Rshz0RzMGLg= =SuiI -----END PGP SIGNATURE-----
Jan 31 2006