How to make AA key a pointer
Rene Zwanenburg
renezwanenburg at gmail.com
Mon Feb 19 15:00:39 UTC 2018
On Monday, 19 February 2018 at 14:57:47 UTC, Clinton wrote:
> On Monday, 19 February 2018 at 14:55:01 UTC, Clinton wrote:
>> Hi all, I need advice from better developers on this concern.
>>
>> I'm using an AA to reference another array for quicker access:
>>
>> [...]
>
> Sorry, on second look my explanation isn't very clear. I want
> to know if:
>
> bool[string] myAA;
>
> myAA[contact.id] = true; // Does this copy contact.id or is
> this a pointer to contact.id?
It's a pointer. In D, string is an alias to immutable(char)[]
(Slice of immutable characters). A slice is a combination of
pointer and length.
More information about the Digitalmars-d-learn
mailing list