Get pointer or reference of an element in Array(struct)
Arun Chandrasekaran
aruncxy at gmail.com
Sat Dec 9 06:46:27 UTC 2017
On Saturday, 9 December 2017 at 06:38:46 UTC, anonymous wrote:
> On Saturday, 9 December 2017 at 06:15:16 UTC, Arun
> Chandrasekaran wrote:
>> Is there a way to get the pointer or reference of an element
>> in Array(T)?
> [...]
>> auto d2 = gallery[0];
>
> auto d2 = &gallery[0];
Thanks. Just curious why reference can't be obtained here. Saves
nasty null checks in most places.
More information about the Digitalmars-d-learn
mailing list