fork download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. void distance(int a, int b) {
  6. }
  7.  
  8. int main() {
  9. distance(1, 2);
  10. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
In file included from /usr/include/c++/4.8/bits/stl_algobase.h:65:0,
                 from /usr/include/c++/4.8/bits/char_traits.h:39,
                 from /usr/include/c++/4.8/ios:40,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from prog.cpp:1:
/usr/include/c++/4.8/bits/stl_iterator_base_types.h: In instantiation of ‘struct std::iterator_traits<int>’:
/usr/include/c++/4.8/bits/stl_iterator_base_funcs.h:114:5:   required by substitution of ‘template<class _InputIterator> typename std::iterator_traits<_Iterator>::difference_type std::distance(_InputIterator, _InputIterator) [with _InputIterator = int]’
prog.cpp:9:18:   required from here
/usr/include/c++/4.8/bits/stl_iterator_base_types.h:165:53: error: ‘int’ is not a class, struct, or union type
       typedef typename _Iterator::iterator_category iterator_category;
                                                     ^
/usr/include/c++/4.8/bits/stl_iterator_base_types.h:166:53: error: ‘int’ is not a class, struct, or union type
       typedef typename _Iterator::value_type        value_type;
                                                     ^
/usr/include/c++/4.8/bits/stl_iterator_base_types.h:167:53: error: ‘int’ is not a class, struct, or union type
       typedef typename _Iterator::difference_type   difference_type;
                                                     ^
/usr/include/c++/4.8/bits/stl_iterator_base_types.h:168:53: error: ‘int’ is not a class, struct, or union type
       typedef typename _Iterator::pointer           pointer;
                                                     ^
/usr/include/c++/4.8/bits/stl_iterator_base_types.h:169:53: error: ‘int’ is not a class, struct, or union type
       typedef typename _Iterator::reference         reference;
                                                     ^
stdout
Standard output is empty