Re: Aliasing member's members

2018-02-26 Thread ketmar via Digitalmars-d-learn
Kayomn wrote: On Monday, 26 February 2018 at 21:04:51 UTC, TheFlyingFiddle wrote: On Monday, 26 February 2018 at 20:50:35 UTC, Kayomn wrote: [...] Don't think you can alias member variables directly. You could do this though: struct Player { Entity entity; ref auto pos() inout { r

Re: Aliasing member's members

2018-02-26 Thread Kayomn via Digitalmars-d-learn
On Monday, 26 February 2018 at 21:04:51 UTC, TheFlyingFiddle wrote: On Monday, 26 February 2018 at 20:50:35 UTC, Kayomn wrote: [...] Don't think you can alias member variables directly. You could do this though: struct Player { Entity entity; ref auto pos() inout { return entity.pos

Re: Aliasing member's members

2018-02-26 Thread TheFlyingFiddle via Digitalmars-d-learn
On Monday, 26 February 2018 at 20:50:35 UTC, Kayomn wrote: I've been experimenting with D's Better C mode, and I have a question regarding something that I started thinking about after watching one of Jonathon Blow's talks on data-oriented programming - more specifically the aspect of fake "inh

Aliasing member's members

2018-02-26 Thread Kayomn via Digitalmars-d-learn
I've been experimenting with D's Better C mode, and I have a question regarding something that I started thinking about after watching one of Jonathon Blow's talks on data-oriented programming - more specifically the aspect of fake "inheritance" I have the following code. My question is if it'