Properties and const

Janice Caron caron800 at googlemail.com
Tue Sep 11 11:43:58 PDT 2007


Hi,

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
re-prototyped?

As in

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

?



More information about the Digitalmars-d mailing list