merging a group result

Alex sascha.orlov at gmail.com
Mon Jul 23 12:16:32 UTC 2018


On Monday, 23 July 2018 at 12:07:37 UTC, Seb wrote:
>
> You could use chunkBy:
>
> auto res = sarr.chunkBy!((a, b) => a.s == b.s).map!(a => 
> tuple(a.front.s, a.map!(b => b.i).sum));
> https://run.dlang.io/is/TJOEmf
>

Ha... This helps! Thanks a lot! :)



More information about the Digitalmars-d-learn mailing list