fork download
  1. //Returns a pointer to the Nth value.
  2.  
  3. template<typename It, typename Ty>
  4. It find_next(It first, It last, const Ty& val, int N)
  5. {
  6. for (; first != last; ++first)
  7. {
  8. if (*first == val) N--;
  9. if (N == 0) break;
  10. }
  11.  
  12. return first;
  13. }
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty