Auto-Implemented properties

michaelc37 michaelc37 at msn.com
Sat Jan 5 15:36:58 PST 2013


On Saturday, 5 January 2013 at 23:00:48 UTC, monarch_dodra wrote:
> On Saturday, 5 January 2013 at 22:53:44 UTC, Philippe Sigaud 
> wrote:
>> Hi Michael,
>>
>> your code works for me (DMD 2.061, Linux), with a semicolon 
>> after the alias
>> in class Bar.
>>
>> Also, use writeln, not writefln, because writefln assumes the 
>> first
>> parameter is the formatting string.
>
> Why would you want get/set though when D offers property 
> functions?
>
> The argument of "if your public attribute becomes private, then 
> code breaks" is invalid in D.

I'm not sure if i ever would use the template, but anyway I was 
having a cs vs d argument with a friend, and we ended up writing 
code samples for comparison.

This is just one of the items that came up.


More information about the Digitalmars-d-learn mailing list