walkBack follow-up: Mention fold's potential in the examples

This commit is contained in:
Sebastian Wilzbach 2017-03-02 02:18:07 +01:00
parent 8b4f16182d
commit 0f7952c4d8

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