23 Apr
2009
23 Apr
'09
1:15 a.m.
AMDG Bruce Laing wrote:
Hi, I would like to do something like this:
struct a_name { std::string name; }; a_name names[] = { std::string("one"), std::string("two") }; std::for_each( &names[0], &names[1], if_(1) [ std::cout << arg1.name ] );
but VC8 complains "error C2039: 'name' : is not a member of 'boost::phoenix::actor<Eval>'"
Can anyone tell me what I'm doing wrong here?
Thanks for your insights,
Try bind(&a_name::name, arg1). For arg1.name to work, all the possible member names would have to be enumerated in the definition of arg1 which is not feasible. In Christ, Steven Watanabe