
On May 21, 6:21 pm, alfC
I have a lambda expression that is suppoalways constructed as [some lambda expression] / ( _1 - c); What I need is a function that given the expression returns the internal value of c, if that is possible:
Answering to myself, hope it is useful to someone else:
It turns out that extracting c from the lambda expression f_expr is
quite easy. just
boost::tuples::get<1>(boost::tuples::get<1>(f_expr.args).args),
The tricky part is to write the argument type of the function that
extracts 'c' only in the case that the expression if of type 'XX/(_1-
c)'
Below is the full function that has to be defined to extract c, if the
expression is not of type XX/(_1-c) the function is not even
instantiated:
template<class LambdaExp>
double extract_c(
//typename simple_rational_function<LambdaExp>::type const& //
doing a convenient typedef doesn't work, at least for gcc
lambda_functor