The best way to store a structure by reference

H. S. Teoh via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Nov 27 08:11:31 PST 2015


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 nothing strange about pointers in D code. They're relatively
rare thanks to the various nice abstractions D offers, but you do still
see them from time to time (e.g., in expressions like `x in aa`).


T

-- 
He who laughs last thinks slowest.


More information about the Digitalmars-d-learn mailing list