Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- using namespace std;
- int main(){
- vector<int> aList;
- aList.insert(10); // iterator purposely missed here
- return 0;
- }
- /***
- Error message when you build with g++
- test.cpp: In function 'int main()':
- test.cpp:9: error: no matching function for call to 'std::vector<int, std::allocator<int> >::insert(int)'
- /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>]
- /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>]
- .... really?
- ***/
Add Comment
Please, Sign In to add comment