fork download
  1. class Foo {
  2. int opApply(scope int delegate(ref int) dg)
  3. {
  4. return 0;
  5. }
  6. }
  7. class Bar {
  8. Foo foo;
  9. void hoge() const
  10. {
  11. foreach(fuga; foo){
  12. }
  13. }
  14. }
  15. void main() {
  16. (new Bar()).hoge();
  17. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.d(11): Error: function prog.Foo.opApply (scope int delegate(ref int) dg) is not callable using argument types (int delegate(ref int)) const
stdout
Standard output is empty