
Eric Niebler a écrit :
<snip very beautifully written transform>
I take this as a compliment :D
Could you post the code? The problem is probably pretty simple. The complete code ? Wow, it may end up rather large. I'll pack it in some archive of only the DSL related part and attach it to this mail. It won't be compilable though as it has large roots into a even larger project. It's true, with make_expr you can create expressions that don't conform to the grammar for your domain. But a call to make_expr is pretty explicit -- it can't happen by accident. And make_expr is to be used by DSEL designers such as yourself who may use it to build an expression template piecemeal ... the intermediate pieces of which may not conform to the grammar, while the whole might. Does that make sense? I see. So it's my responsibility to write correct make_expr code then to SFINAE them out if I need it. The current problem arise with a simple complex number DSL I'm writing as an introductory example for a master degree 'Generic Programming in C++' lesson I'm building up. I have a conj_ tag which represents taking the conjugate of a complex number.
The function itself is :
template<class X>
typename proto::result_of::make_expr