Re: style question on structs

2013-12-29 Thread Ali Çehreli
On 12/29/2013 10:58 AM, Jonathan wrote: > Given a struct > > struct Foo{ >enum INT_C {Yes, No} >INT_C a; > } [...] > The second choice is: do we qualify by the struct name: > > this(int y) > { >//option 1 >a = Foo.INT_C.Yes; That's what I do without thinking much about it. >

Re: style question on structs

2013-12-29 Thread John Colvin
On Sunday, 29 December 2013 at 18:58:07 UTC, Jonathan wrote: Given a struct struct Foo{ enum INT_C {Yes, No} INT_C a; } -- we wish to make a constructor. We want to set the answer to Yes if we construct the struct with an integer. There are some stylistic choices to be made. The first

style question on structs

2013-12-29 Thread Jonathan
Given a struct struct Foo{ enum INT_C {Yes, No} INT_C a; } -- we wish to make a constructor. We want to set the answer to Yes if we construct the struct with an integer. There are some stylistic choices to be made. The first choice is: do we use this (I seem to recall being told in Ja