bool contain( const ConstPartVector & v , const Part & part ) { ConstPartVector::const_iterator e = v.end(); ConstPartVector::const_iterator i = v.begin(); i = std::lower_bound( i , e , part , PartLess() ); return i != e && *i == & part ; }
Selector selectIntersection( const ConstPartVector& intersection_part_vector ) { Selector selector; if (intersection_part_vector.size() > 0) { selector = *intersection_part_vector[0]; for (unsigned i = 1 ; i < intersection_part_vector.size() ; ++i) { selector &= *intersection_part_vector[i]; } } return selector; }
bool insert( ConstPartVector & v , const Part & part ) { const ConstPartVector::iterator e = v.end(); ConstPartVector::iterator i = v.begin(); i = std::lower_bound( i , e , part , PartLess() ); const bool new_member = i == e || *i != & part ; if ( new_member ) { v.insert( i , &part ); } return new_member ; }