Merge pull request #5227 from wilzbach/fold-walkBack

walkBack follow-up: Mention fold's potential in the examples
This commit is contained in:
Sebastian Wilzbach 2017-03-02 02:52:05 +01:00 committed by GitHub
commit 7bd4c60c0c

View file

@ -3206,6 +3206,9 @@ if (fun.length >= 1)
// Can be used in a UFCS chain
assert(arr.map!(a => a + 1).fold!((a, b) => a + b) == 20);
// Return the last element of any range
assert(arr.fold!((a, b) => b) == 5);
}
@safe @nogc pure nothrow unittest