Re: struct or class

2014-08-24 Thread Kiith-Sa via Digitalmars-d-learn
On Sunday, 24 August 2014 at 11:56:44 UTC, nikki wrote: I come from languages that don't offer structs, I have this json load function that has to keep some data and intuitively I've written a struct, I've read about the differences, heap vs stack, value vs reference, but know I think i am over

Re: struct or class

2014-08-24 Thread ketmar via Digitalmars-d-learn
On Sun, 24 Aug 2014 11:56:42 + nikki via Digitalmars-d-learn wrote: > Or should I use a class for that AtlasSpriteData? > reading about it I get the impression everytime I'll look up data > from that dictionary data will get copied ? p.s. this will not copy: auto sd = "mysprite00" in dic

Re: struct or class

2014-08-24 Thread ketmar via Digitalmars-d-learn
On Sun, 24 Aug 2014 11:56:42 + nikki via Digitalmars-d-learn wrote: > Or should I use a class for that AtlasSpriteData? > reading about it I get the impression everytime I'll look up data > from that dictionary data will get copied ? this will copy: auto sd = dict[0]; this will copy:

Re: struct or class

2014-08-24 Thread FreeSlave via Digitalmars-d-learn
On Sunday, 24 August 2014 at 11:56:44 UTC, nikki wrote: I come from languages that don't offer structs, I have this json load function that has to keep some data and intuitively I've written a struct, I've read about the differences, heap vs stack, value vs reference, but know I think i am over

Re: struct or class

2014-08-24 Thread Rikki Cattermole via Digitalmars-d-learn
On 24/08/2014 11:56 p.m., nikki wrote: I come from languages that don't offer structs, I have this json load function that has to keep some data and intuitively I've written a struct, I've read about the differences, heap vs stack, value vs reference, but know I think i am overthinking it. Here