I consider that Phoenix lambda functions is somehow C++11 lambda. So I try the following:
http://coliru.stacked-crooked.com/a/38f1a2b655ea70fc
#include <boost/phoenix.hpp>
#include <iostream>
#include <ostream>
using namespace std;
using namespace boost;
using namespace phoenix;
using namespace arg_names;
using namespace local_names;
struct FakeOne{
int field;
};
int main()
{
auto k = FakeOne();
auto fn = (lambda(_a=k)[_a.field ]);
cout <<
fn()
<< endl;
}
Which throws:
main.cpp:20:32: error: 'const _a_type' has no member named 'field'
auto fn = (lambda(_a=k)[_a.field ]);