bool SomeCollection::GetObjects(vector* objects) const { objects->clear(); typedef vector::const_iterator Iterator; for (Iterator i = collection_.begin(); i != collection_.end(); ++i) { if ((*i)->IsFubarred()) return false; objects->push_back(*i); } return true;}
bool SomeCollection::GetObjects(vector* objects) const { vector known_good_objects; typedef vector::const_iterator Iterator; for (Iterator i = collection_.begin(); i != collection_.end(); ++i) { if ((*i)->IsFubarred()) return false; known_good_objects->push_back(*i); } objects->swap(known_good_objects); return true;}
The comments you read and contribute here belong only to the person who posted them. We reserve the right to remove off-topic comments.
No comments :
Post a Comment
The comments you read and contribute here belong only to the person who posted them. We reserve the right to remove off-topic comments.