fork download
  1. #include <vector>
  2. #include <set>
  3.  
  4. #include <algorithm>
  5.  
  6. struct point //A simple custom point structure
  7. {
  8. int x, y;
  9. };
  10.  
  11. int main()
  12. {
  13. std::vector<point> v;
  14. std::sort(v.begin(), v.end()); //Fails to compile with point structures
  15.  
  16. std::set<point> s;
  17. s.find(point()); //Fails to compile with point structures
  18.  
  19. return 0;
  20. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/include/g++-v4/bits/stl_algo.h: In function ‘const _Tp& std::__median(const _Tp&, const _Tp&, const _Tp&) [with _Tp = point]’:
/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/include/g++-v4/bits/stl_algo.h:1919:   instantiated from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<point*, std::vector<point, std::allocator<point> > >, _Size = int]’
/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/include/g++-v4/bits/stl_algo.h:4783:   instantiated from ‘void std::sort(_RAIter, _RAIter) [with _RAIter = __gnu_cxx::__normal_iterator<point*, std::vector<point, std::allocator<point> > >]’
prog.cpp:14:   instantiated from here
/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/include/g++-v4/bits/stl_algo.h:93: error: no match for ‘operator<’ in ‘__a < __b’
/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/include/g++-v4/bits/stl_algo.h:94: error: no match for ‘operator<’ in ‘__b < __c’
/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/include/g++-v4/bits/stl_algo.h:96: error: no match for ‘operator<’ in ‘__a < __c’
/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/include/g++-v4/bits/stl_algo.h:100: error: no match for ‘operator<’ in ‘__a < __c’
/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/include/g++-v4/bits/stl_algo.h:102: error: no match for ‘operator<’ in ‘__b < __c’
/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/include/g++-v4/bits/stl_algo.h: In function ‘_RandomAccessIterator std::__unguarded_partition(_RandomAccessIterator, _RandomAccessIterator, _Tp) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<point*, std::vector<point, std::allocator<point> > >, _Tp = point]’:
/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/include/g++-v4/bits/stl_algo.h:1919:   instantiated from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<point*, std::vector<point, std::allocator<point> > >, _Size = int]’
/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/include/g++-v4/bits/stl_algo.h:4783:   instantiated from ‘void std::sort(_RAIter, _RAIter) [with _RAIter = __gnu_cxx::__normal_iterator<point*, std::vector<point, std::allocator<point> > >]’
prog.cpp:14:   instantiated from here
/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/include/g++-v4/bits/stl_algo.h:1860: error: no match for ‘operator<’ in ‘__first.__gnu_cxx::__normal_iterator<_Iterator, _Container>::operator* [with _Iterator = point*, _Container = std::vector<point, std::allocator<point> >]() < __pivot’
/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/include/g++-v4/bits/stl_algo.h:1919:   instantiated from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<point*, std::vector<point, std::allocator<point> > >, _Size = int]’
/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/include/g++-v4/bits/stl_algo.h:4783:   instantiated from ‘void std::sort(_RAIter, _RAIter) [with _RAIter = __gnu_cxx::__normal_iterator<point*, std::vector<point, std::allocator<point> > >]’
prog.cpp:14:   instantiated from here
/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/include/g++-v4/bits/stl_algo.h:1863: error: no match for ‘operator<’ in ‘__pivot < __last.__gnu_cxx::__normal_iterator<_Iterator, _Container>::operator* [with _Iterator = point*, _Container = std::vector<point, std::allocator<point> >]()’
/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/include/g++-v4/bits/stl_algo.h: In function ‘void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<point*, std::vector<point, std::allocator<point> > >]’:
/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/include/g++-v4/bits/stl_algo.h:1829:   instantiated from ‘void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<point*, std::vector<point, std::allocator<point> > >]’
/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/include/g++-v4/bits/stl_algo.h:4785:   instantiated from ‘void std::sort(_RAIter, _RAIter) [with _RAIter = __gnu_cxx::__normal_iterator<point*, std::vector<point, std::allocator<point> > >]’
prog.cpp:14:   instantiated from here
/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/include/g++-v4/bits/stl_algo.h:1757: error: no match for ‘operator<’ in ‘__val < __first.__gnu_cxx::__normal_iterator<_Iterator, _Container>::operator* [with _Iterator = point*, _Container = std::vector<point, std::allocator<point> >]()’
/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/include/g++-v4/bits/stl_function.h: In member function ‘bool std::less<_Tp>::operator()(const _Tp&, const _Tp&) const [with _Tp = point]’:
/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/include/g++-v4/bits/stl_tree.h:1395:   instantiated from ‘std::_Rb_tree_iterator<_Val> std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::find(const _Key&) [with _Key = point, _Val = point, _KeyOfValue = std::_Identity<point>, _Compare = std::less<point>, _Alloc = std::allocator<point>]’
/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/include/g++-v4/bits/stl_set.h:505:   instantiated from ‘typename std::_Rb_tree<_Key, _Key, std::_Identity<_Key>, _Compare, typename _Alloc::rebind<_Key>::other>::const_iterator std::set<_Key, _Compare, _Alloc>::find(const _Key&) [with _Key = point, _Compare = std::less<point>, _Alloc = std::allocator<point>]’
prog.cpp:17:   instantiated from here
/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/include/g++-v4/bits/stl_function.h:230: error: no match for ‘operator<’ in ‘__x < __y’
/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/include/g++-v4/bits/stl_algo.h: In function ‘void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<point*, std::vector<point, std::allocator<point> > >]’:
/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/include/g++-v4/bits/stl_algo.h:4634:   instantiated from ‘void std::partial_sort(_RAIter, _RAIter, _RAIter) [with _RAIter = __gnu_cxx::__normal_iterator<point*, std::vector<point, std::allocator<point> > >]’
/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/include/g++-v4/bits/stl_algo.h:1907:   instantiated from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<point*, std::vector<point, std::allocator<point> > >, _Size = int]’
/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/include/g++-v4/bits/stl_algo.h:4783:   instantiated from ‘void std::sort(_RAIter, _RAIter) [with _RAIter = __gnu_cxx::__normal_iterator<point*, std::vector<point, std::allocator<point> > >]’
prog.cpp:14:   instantiated from here
/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/include/g++-v4/bits/stl_algo.h:1559: error: no match for ‘operator<’ in ‘__i.__gnu_cxx::__normal_iterator<_Iterator, _Container>::operator* [with _Iterator = point*, _Container = std::vector<point, std::allocator<point> >]() < __first.__gnu_cxx::__normal_iterator<_Iterator, _Container>::operator* [with _Iterator = point*, _Container = std::vector<point, std::allocator<point> >]()’
/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/include/g++-v4/bits/stl_algo.h: In function ‘void std::__unguarded_linear_insert(_RandomAccessIterator, _Tp) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<point*, std::vector<point, std::allocator<point> > >, _Tp = point]’:
/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/include/g++-v4/bits/stl_algo.h:1763:   instantiated from ‘void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<point*, std::vector<point, std::allocator<point> > >]’
/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/include/g++-v4/bits/stl_algo.h:1829:   instantiated from ‘void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<point*, std::vector<point, std::allocator<point> > >]’
/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/include/g++-v4/bits/stl_algo.h:4785:   instantiated from ‘void std::sort(_RAIter, _RAIter) [with _RAIter = __gnu_cxx::__normal_iterator<point*, std::vector<point, std::allocator<point> > >]’
prog.cpp:14:   instantiated from here
/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/include/g++-v4/bits/stl_algo.h:1718: error: no match for ‘operator<’ in ‘__val < __next.__gnu_cxx::__normal_iterator<_Iterator, _Container>::operator* [with _Iterator = point*, _Container = std::vector<point, std::allocator<point> >]()’
/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/include/g++-v4/bits/stl_heap.h: In function ‘void std::__adjust_heap(_RandomAccessIterator, _Distance, _Distance, _Tp) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<point*, std::vector<point, std::allocator<point> > >, _Distance = int, _Tp = point]’:
/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/include/g++-v4/bits/stl_heap.h:392:   instantiated from ‘void std::make_heap(_RAIter, _RAIter) [with _RAIter = __gnu_cxx::__normal_iterator<point*, std::vector<point, std::allocator<point> > >]’
/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/include/g++-v4/bits/stl_algo.h:1557:   instantiated from ‘void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<point*, std::vector<point, std::allocator<point> > >]’
/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/include/g++-v4/bits/stl_algo.h:4634:   instantiated from ‘void std::partial_sort(_RAIter, _RAIter, _RAIter) [with _RAIter = __gnu_cxx::__normal_iterator<point*, std::vector<point, std::allocator<point> > >]’
/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/include/g++-v4/bits/stl_algo.h:1907:   instantiated from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<point*, std::vector<point, std::allocator<point> > >, _Size = int]’
/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/include/g++-v4/bits/stl_algo.h:4783:   instantiated from ‘void std::sort(_RAIter, _RAIter) [with _RAIter = __gnu_cxx::__normal_iterator<point*, std::vector<point, std::allocator<point> > >]’
prog.cpp:14:   instantiated from here
/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/include/g++-v4/bits/stl_heap.h:232: error: no match for ‘operator<’ in ‘__first.__gnu_cxx::__normal_iterator<_Iterator, _Container>::operator+ [with _Iterator = point*, _Container = std::vector<point, std::allocator<point> >](((const ptrdiff_t&)((const ptrdiff_t*)(& __secondChild)))).__gnu_cxx::__normal_iterator<_Iterator, _Container>::operator* [with _Iterator = point*, _Container = std::vector<point, std::allocator<point> >]() < __first.__gnu_cxx::__normal_iterator<_Iterator, _Container>::operator+ [with _Iterator = point*, _Container = std::vector<point, std::allocator<point> >](((const ptrdiff_t&)((const ptrdiff_t*)(&(__secondChild + -0x000000001))))).__gnu_cxx::__normal_iterator<_Iterator, _Container>::operator* [with _Iterator = point*, _Container = std::vector<point, std::allocator<point> >]()’
/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/include/g++-v4/bits/stl_heap.h: In function ‘void std::__push_heap(_RandomAccessIterator, _Distance, _Distance, _Tp) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<point*, std::vector<point, std::allocator<point> > >, _Distance = int, _Tp = point]’:
/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/include/g++-v4/bits/stl_heap.h:244:   instantiated from ‘void std::__adjust_heap(_RandomAccessIterator, _Distance, _Distance, _Tp) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<point*, std::vector<point, std::allocator<point> > >, _Distance = int, _Tp = point]’
/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/include/g++-v4/bits/stl_heap.h:392:   instantiated from ‘void std::make_heap(_RAIter, _RAIter) [with _RAIter = __gnu_cxx::__normal_iterator<point*, std::vector<point, std::allocator<point> > >]’
/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/include/g++-v4/bits/stl_algo.h:1557:   instantiated from ‘void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<point*, std::vector<point, std::allocator<point> > >]’
/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/include/g++-v4/bits/stl_algo.h:4634:   instantiated from ‘void std::partial_sort(_RAIter, _RAIter, _RAIter) [with _RAIter = __gnu_cxx::__normal_iterator<point*, std::vector<point, std::allocator<point> > >]’
/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/include/g++-v4/bits/stl_algo.h:1907:   instantiated from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<point*, std::vector<point, std::allocator<point> > >, _Size = int]’
/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/include/g++-v4/bits/stl_algo.h:4783:   instantiated from ‘void std::sort(_RAIter, _RAIter) [with _RAIter = __gnu_cxx::__normal_iterator<point*, std::vector<point, std::allocator<point> > >]’
prog.cpp:14:   instantiated from here
/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/include/g++-v4/bits/stl_heap.h:134: error: no match for ‘operator<’ in ‘__first.__gnu_cxx::__normal_iterator<_Iterator, _Container>::operator+ [with _Iterator = point*, _Container = std::vector<point, std::allocator<point> >](((const ptrdiff_t&)((const ptrdiff_t*)(& __parent)))).__gnu_cxx::__normal_iterator<_Iterator, _Container>::operator* [with _Iterator = point*, _Container = std::vector<point, std::allocator<point> >]() < __value’
stdout
Standard output is empty