Sorry, this is the rest of the program: :) struct S { int i; static size_t copyCount;
this(this) { ++copyCount; if (!(copyCount % 2)) { throw new Exception("Failed to copy S"); } } } auto next(Range)(ref Range a){ auto b = a.front; a.popFront(); return b; } Ali