On Wednesday, June 26, 2013 13:16:16 monarch_dodra wrote: > It seems safe, however, your example seems to show how to indeed > break the type system... without a cast (!): > > @property > Point* ptr() inout { > points[this.id].x = cast(int) this.x; > points[this.id].y = cast(int) this.y; > > return points[this.id]; > } > > > void main() { > immutable TplPoint!float my = TplPoint!float(42, 23); > Point* p = my.ptr; //Oops! mutable point! > } > > Disturbing...
It doesn't break anything. It just shows the need for pure. - Jonathan M Davis