fork download
  1. class Foo {
  2. int opApply(scope int delegate(ref int) const 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(3): const/immutable/shared/inout attributes are only valid for non-static member functions
stdout
Standard output is empty