Thread overview |
---|
July 08, 2004 Properties requiring () in some cases | ||||
---|---|---|---|---|
| ||||
class Foo { static bit prop() { return false; } } int main() { if(1 && Foo.prop) { } // bit() does not have a boolean value switch(Foo.prop) { } // 'prop' is not an integral type return 0; } The first 2 statements in main() only work if Foo.prop() is used. I think it thinks it's a function address like old times. |
July 08, 2004 Re: Properties requiring () in some cases | ||||
---|---|---|---|---|
| ||||
Posted in reply to Vathix | Also: class Foo { static char[] charprop() { return null; } } int main() { foreach(char ch; Foo.charprop) { } // foreach: char[]() is not an aggregate type return 0; } |
July 21, 2004 Re: Properties requiring () in some cases | ||||
---|---|---|---|---|
| ||||
Posted in reply to Vathix | In constructor parameters, too.. |
Copyright © 1999-2021 by the D Language Foundation