Guest User

Untitled

a guest
Jun 21st, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3.  
  4. using namespace std;
  5.  
  6. int main(){
  7. vector<int> aList;
  8.  
  9. aList.insert(10); // iterator purposely missed here
  10.  
  11. return 0;
  12. }
  13.  
  14. /***
  15. Error message when you build with g++
  16.  
  17. test.cpp: In function 'int main()':
  18. test.cpp:9: error: no matching function for call to 'std::vector<int, std::allocator<int> >::insert(int)'
  19. /usr/include/c++/4.3/bits/vector.tcc:94: note: candidates are: typename std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::insert(__gnu_cxx::__normal_iterator<typename std::_Vector_base<_Tp, _Alloc>::_Tp_alloc_type::pointer, std::vector<_Tp, _Alloc> >, const _Tp&) [with _Tp = int, _Alloc = std::allocator<int>]
  20. /usr/include/c++/4.3/bits/stl_vector.h:791: note: void std::vector<_Tp, _Alloc>::insert(__gnu_cxx::__normal_iterator<typename std::_Vector_base<_Tp, _Alloc>::_Tp_alloc_type::pointer, std::vector<_Tp, _Alloc> >, size_t, const _Tp&) [with _Tp = int, _Alloc = std::allocator<int>]
  21.  
  22. .... really?
  23. ***/
Add Comment
Please, Sign In to add comment