Y
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
alex_muscar
1224 days ago
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.
link
smcl
1224 days ago
Is that available at compile time, though?
link
mhh__
1224 days ago
Yes
link
smcl
1223 days ago
Oh neat, I'm still a dlang noob and only used it in Crafting Interpreters :)
link