Hi,
You can disguise method calls into variables by using the @property tag.
interface Sizeable
{
// Getter
@property int size();
// Setter
@property int size(int s);
}
class A : Sizeable
{
int m_size;
public:
this()
{
}
@property int size() { return
I like the possibility of abandoning () in function calls in D, so we
can firstly make attribute public and then if implementation changes,
smoothly change it into function:
call:
code
auto a = new A();
writeln(Size is +a.size);
auto b = new B();
writeln(Size is +b.size);
class A {
On 30/04/11 1:22 PM, Mariusz Gliwiński wrote:
I like the possibility of abandoning () in function calls in D, so we
can firstly make attribute public and then if implementation changes,
smoothly change it into function:
snip
Although, if I'd like to make interface Sizeable, it's impossible to