/in/foo.cc: In function 'int main()':
/in/foo.cc:34:18: error: no matching function for call to 'std::vector<int>::emplace(int&)'
id[x].emplace(i), id[y].emplace(i);
^
In file included from /usr/include/c++/6/vector:64:0,
from /in/foo.cc:4:
/usr/include/c++/6/bits/stl_vector.h:971:9: note: candidate: template<class ... _Args> std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::emplace(std::vector<_Tp, _Alloc>::const_iterator, _Args&& ...) [with _Args = {_Args ...}; _Tp = int; _Alloc = std::allocator<int>]
emplace(const_iterator __position, _Args&&... __args);
^~~~~~~
/usr/include/c++/6/bits/stl_vector.h:971:9: note: template argument deduction/substitution failed:
/in/foo.cc:34:18: note: cannot convert 'i' (type 'int') to type 'std::vector<int>::const_iterator {aka __gnu_cxx::__normal_iterator<const int*, std::vector<int> >}'
id[x].emplace(i), id[y].emplace(i);
^
/in/foo.cc:34:36: error: no matching function for call to 'std::vector<int>::emplace(int&)'
id[x].emplace(i), id[y].emplace(i);
^
In file included from /usr/include/c++/6/vector:64:0,
from /in/foo.cc:4:
/usr/include/c++/6/bits/stl_vector.h:971:9: note: candidate: template<class ... _Args> std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::emplace(std::vector<_Tp, _Alloc>::const_iterator, _Args&& ...) [with _Args = {_Args ...}; _Tp = int; _Alloc = std::allocator<int>]
emplace(const_iterator __position, _Args&&... __args);
^~~~~~~
/usr/include/c++/6/bits/stl_vector.h:971:9: note: template argument deduction/substitution failed:
/in/foo.cc:34:36: note: cannot convert 'i' (type 'int') to type 'std::vector<int>::const_iterator {aka __gnu_cxx::__normal_iterator<const int*, std::vector<int> >}'
id[x].emplace(i), id[y].emplace(i);
^