class Foo { int opApply(scope int delegate(ref int) dg) { return 0; } } class Bar { Foo foo; void hoge() const { foreach(fuga; foo){ } } } void main() { (new Bar()).hoge(); }