algorithm's .filter!() by range key

Charles via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Feb 9 12:40:44 PST 2016


This seems to be true of any range function really... is there a 
way to access the key within my range?

Example of what I want to do:

auto x = [1,2,3,4,5];
x.filter( x_key % 2 == 1 ).sum(); // sum odd elements in array


More information about the Digitalmars-d-learn mailing list