1 import std.algorithm: filter;
2 import std.range: iota, takeNone, array;
3 import optional: some, none;
4 auto evens = 10.iota.filter!"a % 2 == 0".array;
5 assert(evens.withBack!"a" == some(8));
6 assert(evens.takeNone.maybeBack == none);
7 assert(evens.takeNone.backOr(100) == 100);
Provides methods for accessing the back of a range