Bar::value() returns a float and is an override. _bar is a member Klass. Can the following be captured? If so what is the best approach with C++14?
void Klass::foo(void)
{
using Expression = float (*)(void);
Expression e2 = [](){return _bar.value();};
}
Edit:
From some example code I'm messing around with:
float Y::capture(void)
{
auto e = [=](){return _x.junk();};
Expression f = Expression(e);
return capture(f);
}
G++ 4.9 complains:
error: invalid cast from type ‘Y::capture()::<lambda()>’ to type ‘Y::Expression {aka float (*)()}’
Expression f = Expression(e);