#include #include int main() { namespace phx = boost::phoenix; using namespace phx::arg_names; using phx::ref; using phx::begin; using phx::lambda; using phx::nothing; int data[] = {2,4,6,8,10}; std::vector veca(data, data+5); std::vector vecb(veca.size()); double a,b,c,d,e,f,g,h,i,j; //Works fine phx::transform(ref(veca), begin(ref(vecb)), lambda[arg1+1]) (a,b,c,d,e,f,g,h,i,j); // // //Works fine int acc = phx::accumulate(ref(veca), phx::construct()) (a,b,c,d,e,f,g,h,i,j); // // //Doesn't compile phx::for_each(ref(veca), lambda[arg1+1]) (a, b, c) /*works if you change to 0,1 or 2 arguments*/; }