```d import std; struct Person { string name; ulong age; }
void main() { auto p=[Person("Joel", 43), Person("Timothy", 40)];writeln("Total: ", p.reduce!((a,b) => a.age+b.age)(0UL)); // how do I get the total of ages added together?
} ```
Joel via Digitalmars-d-learn Thu, 20 Apr 2023 12:46:54 -0700
```d import std; struct Person { string name; ulong age; }
void main() { auto p=[Person("Joel", 43), Person("Timothy", 40)];writeln("Total: ", p.reduce!((a,b) => a.age+b.age)(0UL)); // how do I get the total of ages added together?
} ```