Hacker News new | ask | show | jobs
by skocznymroczny 1224 days ago
Unless I am missing something, you can just use .length on a static array:

    int[5] a = [1,2,3,4,5];
    writeln(a.length); // 5
2 comments

Someone on the D subreddit pointed that out as well. I didn't know it was available at compile time. I'll update the post. Thanks.
Is that available at compile time, though?
Yes
Oh neat, I'm still a dlang noob and only used it in Crafting Interpreters :)