c++ - Access member of returned struct in boost lambda/phoenix -


i want replace older code simpler, functor based code. don't want introduce functor class , use boost::lambda/phoenix don't have c++11 @ hand.

old code looks this

int player = ...; point middlept = ...; for(point pt=<magic nested loops>)   if(this->ismilitarybuilding(pt) && (this->getnode(pt).owner == player + 1))     return true; return false; 

i have function calls functor every point (encapsulating magic) , returns true when of calls returns true:

template<class functor> bool checkpts(point middlept, functor f); 

translating first part of if easy:

return checkpts(middlept, bind(&ismilitarybuilding, this, _1)); 

and 2nd i'd want like: bind(&getnode, this, _1).owner == player+1 not supported.

what readable way of doing this? think might solvable binding reference this , calling functions directly using phoenix lambda did not found references go beyond simple 'hello world' lambdas accessing simple member or parameter.


Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

java - Digest auth with Spring Security using javaconfig -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -