@property not available for classes?

Steven Schveighoffer via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Jan 3 09:48:32 PST 2016


On 1/1/16 9:08 PM, Shriramana Sharma wrote:
> John wrote:
>
>> It's nothing to do with the @property attribute. So you need to
>> define a constructor. Also, use "new" when creating instances.
>
> Thanks Simon and John. First actual usage of D classes and mistaken
> assumption that C++ syntax is valid. :-)
>

class constructor requirements are much different from struct 
constructor requirements. There's also no implicit constructor that 
initializes all members as there is for structs.

-Steve


More information about the Digitalmars-d-learn mailing list