Andrei Alexandrescu wrote:
Michiel Helvensteijn wrote:
void empty.set(bool value) { ... }
bool empty.get() { ... }
and have the same meaning as my earlier example.
Yah, I was thinking the same. This is my #1 fave so far.
Andrei
Agreed!
I see the appeal of putting getter/setter pairs within a single pair of
braces, since it groups them together as one logical unit.
BUT...
I think it's more valuable to define them as completely separate, since
you sometimes want to define get/set properties with different access
modifiers (protected setter & public getter == very nice). And then the
brace-enclosed syntax looks kinda goofy to my eyes:
property MyProperty int {
public get; protected set; // WEIRD
}
--benji