```d writeln("Total: ", p.fold!((a,b) => a+b.age)(0UL)); // or writeln("Total: ", reduce!((a,b) => a+b.age)(0UL, p)); ```
Note that `reduce` is the old version of `fold`, which happened when UFCS became a thing.
-Steve
Steven Schveighoffer via Digitalmars-d-learn Thu, 20 Apr 2023 16:21:05 -0700
```d writeln("Total: ", p.fold!((a,b) => a+b.age)(0UL)); // or writeln("Total: ", reduce!((a,b) => a+b.age)(0UL, p)); ```
Note that `reduce` is the old version of `fold`, which happened when UFCS became a thing.
-Steve