Beispiel #1
0
bool AddressesList::addAddress( const Address & address )
{
   for( std::list<Address>::const_iterator it = addresses.begin(); it != addresses.end(); it++)
      if( address.equal(*it)) return false;

   addresses.push_back( Address( address));

   return true;
}
Beispiel #2
0
bool AddressesList::removeAddress( const Address & address)
{
   bool founded = false;
   for( std::list<Address>::iterator it = addresses.begin(); it != addresses.end(); )
   {
      if( address.equal(*it))
      {
         it = addresses.erase(it);
         founded = true;
      }
      else
         it++;
   }

   return founded;
}