   Looking for something in a loop
  This is a trivial question, driven by curiosity alone.When you're looping to check for the existence of something, how do you prefer to "remember" that you found one, once you're outside of the loop?For example, if I wanted to make sure a suit contained the right shape to fit a certain person when that person is looking through them, I don't need to keep any records, other than that the suit supports that person's shape. This is how I could do it:BOOL found_shape = false;for(int m=0; m<Shapes.GetCount(); m++){if( Shapes[m] == Person->GetShape() ){found_shape = true;break;}}Here's another way I could have done it:int m;for(m=0; m<Shapes.GetCount(); m++)if( Shapes[m] == Person->GetShape() )break;BOOL found_shape = ( m < Shapes.GetCount() );Is that basically how everyone does it? Or are there any other ideas?   
  I use find_if().   ;std::set<Shape*> shapes;std::set<Shape*>::const_iterator i = shapes.find(Person->GetShape());if (i == shapes.end()) {  // not found} else {  // found};  I use your first example.