Author
anonymous
about 8 years ago
Language
Compiler
Options
Author
anonymous
about 8 years ago
$
prog.cc: In function 'int main()':
prog.cc:12:61: error: no matching function for call to 'copy(std::istream_iterator<int>&, std::istream_iterator<int> (&)(), std::back_insert_iterator<std::vector<int> >)'
copy(in_iter_start, in_iter_stop, back_inserter(new_vec));
^
In file included from /opt/wandbox/gcc-head/include/c++/7.0.1/bits/char_traits.h:39:0,
from /opt/wandbox/gcc-head/include/c++/7.0.1/ios:40,
from /opt/wandbox/gcc-head/include/c++/7.0.1/ostream:38,
from /opt/wandbox/gcc-head/include/c++/7.0.1/iostream:39,
from prog.cc:2:
/opt/wandbox/gcc-head/include/c++/7.0.1/bits/stl_algobase.h:446:5: note: candidate: template<class _II, class _OI> _OI std::copy(_II, _II, _OI)
copy(_II __first, _II __last, _OI __result)
^~~~
/opt/wandbox/gcc-head/include/c++/7.0.1/bits/stl_algobase.h:446:5: note: template argument deduction/substitution failed:
prog.cc:12:61: note: deduced conflicting types for parameter '_II' ('std::istream_iterator<int>' and 'std::istream_iterator<int> (*)()')
copy(in_iter_start, in_iter_stop, back_inserter(new_vec));
^
In file included from /opt/wandbox/gcc-head/include/c++/7.0.1/bits/locale_facets.h:48:0,
from /opt/wandbox/gcc-head/include/c++/7.0.1/bits/basic_ios.h:37,
from /opt/wandbox/gcc-head/include/c++/7.0.1/ios:44,
from /opt/wandbox/gcc-head/include/c++/7.0.1/ostream:38,
from /opt/wandbox/gcc-head/include/c++/7.0.1/iostream:39,
from prog.cc:2:
/opt/wandbox/gcc-head/include/c++/7.0.1/bits/streambuf_iterator.h:293:5: note: candidate: template<class _CharT> typename __gnu_cxx::__enable_if<std::__is_char<_Tp>::__value, std::ostreambuf_iterator<_CharT> >::__type std::copy(std::istreambuf_iterator<_CharT>, std::istreambuf_iterator<_CharT>, std::ostreambuf_iterator<_CharT>)
copy(istreambuf_iterator<_CharT> __first,
^~~~
/opt/wandbox/gcc-head/include/c++/7.0.1/bits/streambuf_iterator.h:293:5: note: template argument deduction/substitution failed:
prog.cc:12:61: note: 'std::istream_iterator<int>' is not derived from 'std::istreambuf_iterator<_CharT>'
copy(in_iter_start, in_iter_stop, back_inserter(new_vec));
^
Exit Code:
1