On 2009-08-02 06:27:27 -0400, Michel Fortin <michel.for...@michelf.com> said:

   bool empty{}

i.e. the {} means the getter is declared, but defined elsewhere.

What do you think?

I'd prefer this, which can't be misinterpreted as an empty statement:

        bool empty { ... }

In the same vein, I'm now realizing that "bool empty {}" syntax for a declaration is also a little dangerous and inconsistent: contrary to other functions with a return value, the compiler can't issue an error to say you forgot to return a value if you leave the body empty, it'd silently transform it to a declaration instead.

Again, the elipsis solves this.

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

Reply via email to