Boost logo

Boost :

From: Marco Costalba (mcostalba_at_[hidden])
Date: 2007-10-16 05:58:55


Starting to hack with boost libraries I found myself more and more
stumbling across a big brick of C++ language, i.e. SFINAE works on
types only, not on expressions.

If an expression is ill formed there's no SFINAE around that will
avoid you a barfing compiler.

Looking at C++0x I failed to see a future improvement in that
direction, also 'concepts' that will be quite new, apart from helping
in decoding error messages (and this is a BIG help I would add), does
not immediately seem to extend the language in that direction.

For what I have understood 'refinements' are more or less similar to
tag dispatching so does not seem to open completely new gates (of
course this is just a first look opinion, it means that is not
immediately visible to me how to use concepts to add to what you
already can do using a more verbose approach, not that for sure it
does not exist a way).

I would like to ask you if someone has never dreamed of something like

try well_formed
{

  .... your code here...

} catch {

  .... fall back code in case former is not compilable...

};

I would think this would be an extension that greatly will open new
gates to C++.

Just to be clear, I'm not advocating to introduce something like the
above, just to ask if a discussion around the above lines have never
occurred in the C++ community.

Thanks
Marco


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