Compile-time global mutables

HuskyNator HuskyNator at protonmail.ch
Fri Jul 1 12:44:01 UTC 2022


On Friday, 1 July 2022 at 12:24:55 UTC, Adam D Ruppe wrote:
> On Friday, 1 July 2022 at 12:13:03 UTC, HuskyNator wrote:
> I think this isn't technically defined by the language and is a 
> pure library construct. Just the auto-imported library thing/

It is references, but hidden in the text somewhere. (also note it 
seems to be applicable to static arrays as well, though it yields 
0) 
https://dlang.org/spec/arrays.html#dynamic-arrays:~:text=To%20guarantee%20copying%20behavior%2C%20use%20the%20.dup%20property%20to%20ensure%20a%20unique%20array%20that%20can%20be%20resized.%20Also%2C%20one%20may%20use%20the%20.capacity%20property%20to%20determine%20how%20many%20elements%20can%20be%20appended%20to%20the%20array%20without%20reallocating.




More information about the Digitalmars-d mailing list