I am writing a wrapper class which looks like this:
class Wrapper{
private:
std::list<People> men;
std::list<People> woman;
/**
some bizzar logics
**/
public:
std::list<People>::iterator getMeTheNextOne(){};
}
The problem is, sometime, I need to return an empty (or NULL) iterator, saying that there is no more 'suitable' people in either list any more. If I simply return men.end() or women.end(), is the user gonna catch this?
Imaging the user have following code:
Wrapper wo;
std::list<People>::iterator it = wo.getMeTheNextPeople();
if(it == /*what should I put here? i cannot access the list members of the Wrapper*/){
// do something here
}