记录详情

Compile Error

/in/foo.cc: In function 'int main()':
/in/foo.cc:10:28: error: no matching function for call to 'distance(int&, int&, int&, int&)'
  cout<<distance(x1,y1,x2,y2)<<endl;
                            ^
In file included from /usr/include/c++/6/bits/stl_algobase.h:66:0,
                 from /usr/include/c++/6/bits/char_traits.h:39,
                 from /usr/include/c++/6/ios:40,
                 from /usr/include/c++/6/ostream:38,
                 from /usr/include/c++/6/iostream:39,
                 from /in/foo.cc:2:
/usr/include/c++/6/bits/stl_iterator_base_funcs.h:135:5: note: candidate: template<class _InputIterator> typename std::iterator_traits<_Iterator>::difference_type std::distance(_InputIterator, _InputIterator)
     distance(_InputIterator __first, _InputIterator __last)
     ^~~~~~~~
/usr/include/c++/6/bits/stl_iterator_base_funcs.h:135:5: note:   template argument deduction/substitution failed:
/in/foo.cc:10:28: note:   candidate expects 2 arguments, 4 provided
  cout<<distance(x1,y1,x2,y2)<<endl;
                            ^
/in/foo.cc:11:28: error: no matching function for call to 'distance(int&, int&, int&, int&)'
  cout<<distance(x1,y1,x3,y3)<<endl;
                            ^
In file included from /usr/include/c++/6/bits/stl_algobase.h:66:0,
                 from /usr/include/c++/6/bits/char_traits.h:39,
                 from /usr/include/c++/6/ios:40,
                 from /usr/include/c++/6/ostream:38,
                 from /usr/include/c++/6/iostream:39,
                 from /in/foo.cc:2:
/usr/include/c++/6/bits/stl_iterator_base_funcs.h:135:5: note: candidate: template<class _InputIterator> typename std::iterator_traits<_Iterator>::difference_type std::distance(_InputIterator, _InputIterator)
     distance(_InputIterator __first, _InputIterator __last)
     ^~~~~~~~
/usr/include/c++/6/bits/stl_iterator_base_funcs.h:135:5: note:   template argument deduction/substitution failed:
/in/foo.cc:11:28: note:   candidate expects 2 arguments, 4 provided
  cout<<distance(x1,y1,x3,y3)<<endl;
                            ^
/in/foo.cc:12:28: error: no matching function for call to 'distance(int&, int&, int&, int&)'
  cout<<distance(x2,y2,x3,y3)<<endl;
                            ^
In file included from /usr/include/c++/6/bits/stl_algobase.h:66:0,
                 from /usr/include/c++/6/bits/char_traits.h:39,
                 from /usr/include/c++/6/ios:40,
                 from /usr/include/c++/6/ostream:38,
                 from /usr/include/c++/6/iostream:39,
                 from /in/foo.cc:2:
/usr/include/c++/6/bits/stl_iterator_base_funcs.h:135:5: note: candidate: template<class _InputIterator> typename std::iterator_traits<_Iterator>::difference_type std::distance(_InputIterator, _InputIterator)
     distance(_InputIterator __first, _InputIterator __last)
     ^~~~~~~~
/usr/include/c++/6/bits/stl_iterator_base_funcs.h:135:5: note:   template argument deduction/substitution failed:
/in/foo.cc:12:28: note:   candidate expects 2 arguments, 4 provided
  cout<<distance(x2,y2,x3,y3)<<endl;
                            ^

信息

递交者
类型
递交
题目
0
语言
C++
递交时间
2018-07-12 22:30:15
评测时间
2018-07-12 22:30:15
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes