|
Boost : |
From: Mathias Gaunard (mathias.gaunard_at_[hidden])
Date: 2007-10-16 07:03:18
Marco Costalba wrote:
> 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 think Concepts somehow help here. By using a concept to check whether
a type has given member functions or operators with given signatures,
and overloading the piece of code without a concept to be the fallback
code, you get similar things.
Also, you could provide some compile-time reflection to check whether an
expression is valid or not.
> I would think this would be an extension that greatly will open new
> gates to C++.
Such as duck typing?
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk