On 2009-08-02 12:32:16 -0400, Andrei Alexandrescu <seewebsiteforem...@erdani.org> said:

The point is not really the grouping of elements within brackets. That just
eliminates some redundancy. It can also look like the following:

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.

And as a bonus, it makes this look ridiculous:

        void popFront.get() { ... }

which means it won't get so easily twisted for use by functions with no parameters.

The only thing that can get confusing is getting the address of the setter and getter, because get and set aren't keywords and thus could be defined by the returned object.

        &empty.get; // address of what?

--
Michel Fortin
michel.for...@michelf.com
http://michelf.com/

Reply via email to