www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Properties and const


the admittedly now out-of-date documentation for const says, of class
member functions, that the syntax for member functions which do not
modify member variables should be

invariant void foo()

Does that mean that all "getter" property functions will have to be

As in

class C
    private int my_x;
    invariant int x() { return x; }

Sep 11 2007