
16 Oct
2007
16 Oct
'07
11:03 a.m.
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?