Guest User

Untitled

a guest
Jun 19th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. std::vector<int>::iterator it;
  2. // /cut/ search for something in vector and point iterator at it.
  3. if(!it) //check whether found
  4. do_something();
  5.  
  6. std::vector<int>::iterator i = std::find(v.begin(), v.end(), 13);
  7. if (i != v.end())
  8. {
  9. // ...
  10. }
  11.  
  12. if(it != aVector.end()) //past-the-end iterator
  13. do_something();
Add Comment
Please, Sign In to add comment