So how do you create an associative array with an immutable value, anyways?

FeepingCreature feepingcreature at gmail.com
Sat Oct 8 17:09:39 UTC 2022


On Friday, 7 October 2022 at 20:04:48 UTC, Steven Schveighoffer 
wrote:
> On 10/7/22 3:20 PM, FeepingCreature wrote:
>> 
>> Yeah, if I could get the associative array to give me a 
>> pointer to an uninitialized value for a key, that would do it, 
>> I think.
>
> Have you looked at the implementation for require? That's 
> exactly what it does.
>
> For reference: 
> https://github.com/dlang/dmd/blob/f4c21ccd6a73fee7abdea39cc38e8c64b627ffe1/druntime/src/object.d#L3457
>
> -Steve

Yeah okay so it's definitely possible, but I do feel it's kinda 
questionable to call barely documented internal 
implementation-dependent (?) runtime functions from user code...


More information about the Digitalmars-d mailing list