x.sizeof vs typeid(x)
Sergey Gromov
snake.scaly at gmail.com
Wed Feb 6 13:24:22 PST 2008
Christian Kamm wrote:
> It really gets odd when foo is a function as well:
>
> void foo(int i);
> int bar();
>
> foo = bar; // same as foo(bar());
>
> I think property syntax is nice, but should only be valid where it makes
> sense (or only where the user explicitly allowed it).
Agree. If there were, say, an attribute `property', so that you can
write:
foo(double x) {...}
property double distance() {return ...}
foo(distance); // OK
foo(distance()); // OK
foo = distance; // error
it'd be much safer.
SnakE
More information about the Digitalmars-d
mailing list