const violation?

2012-01-13 Thread H. S. Teoh
Why does the following code compile? import std.stdio; int f(ref int x) { return x++; } class A { int x=123; int g() const { return f(x); } } void main() {

Re: const violation?

2012-01-13 Thread Steven Schveighoffer
On Fri, 13 Jan 2012 15:27:56 -0500, H. S. Teoh hst...@quickfur.ath.cx wrote: Why does the following code compile? import std.stdio; int f(ref int x) { return x++; } class A { int x=123; int g() const {