Re: The best way to store a structure by reference

2015-11-27 Thread H. S. Teoh via Digitalmars-d-learn
On Fri, Nov 27, 2015 at 11:38:28AM +0300, drug via Digitalmars-d-learn wrote: > I need to store a struct like a reference type. Now I use pointer for > this, is it the best D way? This pointer is private and access to it > is safe, but it's just unusual for me to see pointers in D code. There's no

Re: The best way to store a structure by reference

2015-11-27 Thread drug via Digitalmars-d-learn
On 27.11.2015 11:38, drug wrote: I need to store a struct like a reference type. Now I use pointer for this, is it the best D way? This pointer is private and access to it is safe, but it's just unusual for me to see pointers in D code. Thank to all for answer. I stay with pointers in my case.

Re: The best way to store a structure by reference

2015-11-27 Thread B.Basile via Digitalmars-d-learn
On Friday, 27 November 2015 at 08:38:29 UTC, drug wrote: I need to store a struct like a reference type. Now I use pointer for this, is it the best D way? This pointer is private and access to it is safe, but it's just unusual for me to see pointers in D code. One thing: take care when compar

Re: The best way to store a structure by reference

2015-11-27 Thread rsw0x via Digitalmars-d-learn
On Friday, 27 November 2015 at 08:38:29 UTC, drug wrote: I need to store a struct like a reference type. Now I use pointer for this, is it the best D way? This pointer is private and access to it is safe, but it's just unusual for me to see pointers in D code. if you own the resource, conside

Re: The best way to store a structure by reference

2015-11-27 Thread Kagamin via Digitalmars-d-learn
I use this http://dpaste.dzfl.pl/b926ff181709 to simulate reference types.

Re: The best way to store a structure by reference

2015-11-27 Thread Ali Çehreli via Digitalmars-d-learn
On 11/27/2015 12:38 AM, drug wrote: I need to store a struct like a reference type. Now I use pointer for this, is it the best D way? This pointer is private and access to it is safe, but it's just unusual for me to see pointers in D code. Agreed but that's the only way. Ali

The best way to store a structure by reference

2015-11-27 Thread drug via Digitalmars-d-learn
I need to store a struct like a reference type. Now I use pointer for this, is it the best D way? This pointer is private and access to it is safe, but it's just unusual for me to see pointers in D code.