{ static auto arrA = [1, 2, 3]; auto r = arrA.whenEmpty!((){ arrA = null; }); assert(equal(r, arrA)); assert(arrA is null); } { static auto arrB = [1, 2, 3]; auto r = arrB.whenEmpty!((){ arrB = null; }); //assert(equal(r, arr)); r.popFront(); r.popFront(); assert(arrB !is null); r.popFront(); assert(arrB is null); }