Anyway to achieve the following

H. S. Teoh hsteoh at quickfur.ath.cx
Fri Aug 13 17:19:43 UTC 2021


On Fri, Aug 13, 2021 at 05:11:50PM +0000, Rekel via Digitalmars-d-learn wrote:
[...]
> For anyone more experienced with C, I'm not well known with references
> but are those semantically similar to the idea of using a type at a
> predefined location?

References are essentially pointers under the hood. The difference is
that at the language level they are treated as aliases to the original
variable, and are therefore guaranteed to be non-null.

Note that in D `ref` is not a type constructor but a storage qualifier,
so you cannot declare a reference variable, you can only get one if you
pass a variable to a function that takes it by ref.


T

-- 
Spaghetti code may be tangly, but lasagna code is just cheesy.


More information about the Digitalmars-d-learn mailing list