|
Boost : |
From: David Abrahams (dave_at_[hidden])
Date: 2003-01-24 20:32:47
"Paul Mensonides" <pmenso57_at_[hidden]> writes:
> ----- Original Message -----
> From: "David Abrahams" <dave_at_[hidden]>
>
>> I tend to agree on a "moral/aesthetic" level, but on a practical level
>> we have to tread carefully. The question, "can we just have an
>> operator which produces a compile-time constant value saying whether
>> its operand is a valid expression?" has come up a few times in the
>> committee. Each time, the implementors looked at their codebases and
>> said "oooh, that's really hard to do." I think the short form of the
>> reason is that C++ compilers generally don't have the ability to
>> recover from errors reliably. That may explain why your 2nd, 3rd,
>> 4th... diagnostic messages tend to be useless gibberish ;-)
>>
>> So, I'd like to push for something like that but practically speaking
>> I'm not sure how to get there.
>
> The problems are not insurmountable though (with an "is_valid_expression").
> You aren't dealing with entire language at this point, only an
> expression.
And which parts of the language does that fail to drag in? Not many.
Actually, not that it matters, but I think I'm misquoting the original
request, which was, IIRC, "tell us whether evaluating this expression
should produce a compilation error." Howard knows for sure...
-- David Abrahams dave_at_[hidden] * http://www.boost-consulting.com Boost support, enhancements, training, and commercial distribution
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk