No, actually I don't at all understand why the function does not need to be const any longer since this code does not compile:

import std.stdio;

class Hugo {
  public int x = 42;

  void blah(this T)(void function(const Hugo h) f) {
    f(this);
  }
}

void main() {
    Hugo hugo = new Hugo();

    const Hugo inge = hugo;
    void function(const Hugo h) g = function(const Hugo h) {
      write("foobar ");
      writeln(h.x);
    };
    inge.blah(g);
}

Sorry guys, I know I'm a bloody D beginner, ...

Reply via email to