logoalt Hacker News

brabellast Sunday at 6:01 PM1 replyview on HN

Walter is showing the equivalent function declaration... you will eventually create a generic type as you say, but in the Zig example, that was a function, not a struct.


Replies

dpassenslast Sunday at 6:20 PM

If my understanding of D's template syntax is correct, then Walter is showing a the declaration of a function called ArrayListType which is generic over T and returns a T. The original Zig code returns the struct type itself, so it is functionally equivalent to my example, provided I understood how D templates work.

show 1 reply