Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2006-04-13 19:34:43


Darren Cook <darren_at_[hidden]> writes:

>>>So,
>>> auto(x){ x->first < 0 }
>>>returns bool, and
>>> auto(x){ x->first < 0; }
>>>returns void?
>>
>> Did I say that? I didn't mean to say that.
>
> Yes, it sounded like that was maybe what you meant (in another
> message in this thread - quoted below).

But I didn't say that. I didn't mean that either. I didn't mean to
make any statement about what happens in the second case. I only made
a claim about its normal behavior when it is part of a function body.
I was claiming that leaving out the semicolon is not only less
needlessly verbose, but it could act as a (admittedly subtle) signal
that it's not just an ordinary statement.

> So what does the version with the semi-colon return? Or would the
> semi-colon be a syntax error?

One viable possibility is that the semicolon could be optional, and
could result in no change of meaning.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk