Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2014
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. std::vector<int> foo = {...whatever...};
  2. std::vector<int> bar;
  3. std::back_insert_iterator< std::vector<int> > back_it (foo);
  4.  
  5. std::copy_if (foo.begin(), foo.end(), back_it, MyPredicate);
  6.  
  7. std::vector<int> foo = {...whatever...};
  8. int mycount = count_if (foo.begin(), foo.end(), MyPredicate);
  9. std::vector<int> bar (mycount);
  10.  
  11. std::copy_if (foo.begin(), foo.end(), bar.begin(), MyPredicate );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement