On 11/05/2010 7:47 PM, alfC wrote:
You'll have to make operator() a template:
template<class T> function
operator()(const T& x_arg, double y_arg); What if I want to restrict T to lambda expressions?
What about forcing T to be or be derived from an expression template base class?
How can I do that? Can you point me to the right documentation if any.
In the context of Boost.Lambda there is no common base class for all expression templates (is there?), for example the placeholders do not inherit from anything. The only thing I found was the subclass 'sig' that seems to be defined for all expression types. But I am still scratching my head on how to expoit this 'sig' subclass.
Now that I think one obvious way to restrict T is to be an expression template that 'returns' a double (or convertible to 'double'), this information is contained in the sig subclass. But I am confused now to do any progress.
Alfredo
I'd also like to add that I'd be very interested to hear about what you've come up with as a solution. Thanks! Geoff