c++ - combine boost unordered_map, bind, and std::find_if -


i have big container of boost::unordered_map below:

typedef boost::unordered_map< vertex, entity > vertex_container;  

the vertex class has coordinate member variable representing location. have several coordinate point_(s). search if vertex inside container exist vertex.coordinate = point.

something like:

vertex_container::iterator = std::find_if(v_container.begin(), v_container.end(), boost::bind(&vertex::coordinate(), _1) == point); 

but fails.

i tried:

vertex_container::iterator = std::find_if(v_container | boost::adaptors::map_keys(boost::bind(&vertex::coordinate(), _1)) == point);  error: cannot call member function ‘mesh::coordinate mesh::vertex::coordinate() const’ without object. 

i somehow try combine boost unordered_map, bind, , std::find_if.

please note able use c++09 standard , boost 1.53.0 version.

what need first bind key out of unordered_map , bind again member function.

vertex_container::iterator = std::find_if( v_container.begin(), v_container.end(), (boost::bind(&vertex::coordinate, (boost::bind( &vertex_container::value_type::first, _1))) == point) ); 

and cannot use pipe within std::find_if.


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -