On Thursday, 30 October 2014 at 10:28:42 UTC, Simon A wrote:
I don't know about syntax, but D sure needs first-class support of tail immutability.


struct A
{
  float * a;

  void foo() tailconst
  {
     writeln(typeof(a).stringof);  //outputs "const(float) *"
  }
}


class B
{
  float * a;

  void foo() tailconst
  {
     writeln(typeof(this).stringof);  //outputs "tailconst(B)"
     writeln(typeof(a).stringof);     //outputs "const float *"
  }
}

tailconst for struct and classes.

How about this?


*sorry about the previous almost empty post.


Reply via email to