Advertisement
Guest User

Untitled

a guest
Sep 24th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.29 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3.  
  4. template<class T>
  5. int binary_search(std::vector<T> items, const T& what) {
  6.     return -1;
  7. }
  8.  
  9. int main() {
  10.     std::vector<int> items {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
  11.     int index = binary_search(items, 2);
  12.     std::cout<<index<<std::endl;
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement