Obtain pointer from static array literal

Imperatorn johan_forsberg_86 at hotmail.com
Sat Oct 9 08:47:43 UTC 2021

On Friday, 8 October 2021 at 14:07:27 UTC, russhy wrote:
> https://run.dlang.io/is/S8uMbp
> It's such a shame that ``[0,1,2,3].ptr`` allocates using GC, 
> even if using ``func(scope const void* ptr)``
> Can't something be done to make this ``[0,1,2,3]`` a static 
> array literal?
> Who thought making it GC allocated was a good idea? i want 
> names!

No idea, but why isn't just slapping a staticArray sufficient?
I feel your rage, but maybe there was a good reason for it :)

More information about the Digitalmars-d-learn mailing list