Inferring static array size

NotYouAgain NotYouAgain at gmail.com
Sun Apr 28 09:59:33 UTC 2024


On Sunday, 28 April 2024 at 09:50:05 UTC, Chloé wrote:
>
> To CTFE a range into a static array, try:
>
>     staticArray!(20.iota)
>
> Note the exclamation mark. This uses the following overload:
>
>     auto staticArray(alias a)()
>         if (isInputRange!(typeof(a)))

Yes that works. Thanks.

Not as intuitive as [$_] would be, but still a usable solution.

At least I don't have to put my array in a separate module for it 
to work ;-)


More information about the dip.ideas mailing list