|
-
December 6th, 2011, 06:56 PM
#5
Re: adding to vector of vector<int>, check if element already present
 Originally Posted by Paul McKenzie
Use std::find_if(), not std::find().
Then you check the return iterator is equal to check_path.end(). If it is, then the item was not found.
Regards,
Paul McKenzie
Find_if returns an iterator to an element if that element returns as true from some second function, right? That second function would have to test equality against the elements in the vector being checked, but I'm not sure what that would look like.
LMHmedchem
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|