July 08, 2004 [?bug/feature?] overwriting the .sizeof of structs | ||||
|---|---|---|---|---|
| ||||
struct TestStructSizeof{
int sizeof;
}
TestStructSizeof s;
s.sizeof will be 0.
Is this a intended feature or a bug?
| ||||
July 11, 2004 Re: [?bug/feature?] overwriting the .sizeof of structs | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Thomas Kuehne | i suppose it's supposed to be legal.. Walter implemented the .sizeof property as not to conflict with structs that had a .size member.. although you would think that declaring a member function as a keyword should be illegal! though .sizeof isn't really a keyword, is it? it's more of an implicit static member variable. perhaps there should be code to prevent its being overridden.. "Thomas Kuehne" <eisvogel@users.sourceforge.net> wrote in message news:ccja6c$18af$1@digitaldaemon.com... > struct TestStructSizeof{ > int sizeof; > } > > TestStructSizeof s; > > s.sizeof will be 0. > > Is this a intended feature or a bug? > | |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply