On Friday, 19 October 2018 at 09:08:32 UTC, Vijay Nayar wrote:
Technically the code you have is syntactically correct. You are permitted to create a class variable without assigning it to a class object. (Assigning it to a class object would look like "A a = new A();")

Which section of The D Programming Language book makes you think this would not compile? I have the book as well, but I'm not quite sure what part of the book you're referring to.

the section 6.2, which is
---
A a;
a.x = 5;
---

the book explained this should be refused to compile.


thanks!

--
dangbinghoo

Reply via email to