Exemple #1
0
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 ;
}
Exemple #2
0
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 ;
}