Record Detail

Compile Error

In file included from /in/driver/main.cpp:8:0:
/in/kdtree.hpp: In instantiation of 'KDTree<std::tuple<_Elements ...>, ValueType>::Node* KDTree<std::tuple<_Elements ...>, ValueType>::copy_helper(const KDTree<std::tuple<_Elements ...>, ValueType>::Node*) [with ValueType = std::__cxx11::basic_string<char>; KeyTypes = {int, int, int}]':
/in/kdtree.hpp:472:33:   required from 'KDTree<std::tuple<_Elements ...>, ValueType>::KDTree(const KDTree<std::tuple<_Elements ...>, ValueType>&) [with ValueType = std::__cxx11::basic_string<char>; KeyTypes = {int, int, int}]'
/in/driver/main.cpp:145:69:   required from here
/in/kdtree.hpp:444:22: error: passing 'const KDTree<std::tuple<int, int, int>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Node' as 'this' argument discards qualifiers [-fpermissive]
         Node *curr = new Node(that_p->key(), that_p->value(), copy_helper(that_p->parent));
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/in/kdtree.hpp:43:20: note:   in call to 'const Key& KDTree<std::tuple<_Elements ...>, ValueType>::Node::key() [with ValueType = std::__cxx11::basic_string<char>; KeyTypes = {int, int, int}; KDTree<std::tuple<_Elements ...>, ValueType>::Key = std::tuple<int, int, int>]'
         const Key &key() { return data.first; }
                    ^~~
/in/kdtree.hpp:444:22: error: passing 'const KDTree<std::tuple<int, int, int>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Node' as 'this' argument discards qualifiers [-fpermissive]
         Node *curr = new Node(that_p->key(), that_p->value(), copy_helper(that_p->parent));
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/in/kdtree.hpp:45:16: note:   in call to 'KDTree<std::tuple<_Elements ...>, ValueType>::Value& KDTree<std::tuple<_Elements ...>, ValueType>::Node::value() [with ValueType = std::__cxx11::basic_string<char>; KeyTypes = {int, int, int}; KDTree<std::tuple<_Elements ...>, ValueType>::Value = std::__cxx11::basic_string<char>]'
         Value &value() { return data.second; }
                ^~~~~
In file included from /usr/include/c++/7/bits/stl_algobase.h:71:0,
                 from /usr/include/c++/7/bits/char_traits.h:39,
                 from /usr/include/c++/7/string:40,
                 from /usr/include/c++/7/stdexcept:39,
                 from /usr/include/c++/7/array:39,
                 from /usr/include/c++/7/tuple:39,
                 from /in/kdtree.hpp:1,
                 from /in/driver/main.cpp:8:
/usr/include/c++/7/bits/predefined_ops.h: In instantiation of 'constexpr bool __gnu_cxx::__ops::_Iter_comp_iter<_Compare>::operator()(_Iterator1, _Iterator2) [with _Iterator1 = __gnu_cxx::__normal_iterator<std::pair<std::tuple<int, int, int>, std::__cxx11::basic_string<char> >*, std::vector<std::pair<std::tuple<int, int, int>, std::__cxx11::basic_string<char> > > >; _Iterator2 = __gnu_cxx::__normal_iterator<std::pair<std::tuple<int, int, int>, std::__cxx11::basic_string<char> >*, std::vector<std::pair<std::tuple<int, int, int>, std::__cxx11::basic_string<char> > > >; _Compare = KDTree<std::tuple<int, int, int>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Node* (*)(KDTree<std::tuple<int, int, int>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Node*, KDTree<std::tuple<int, int, int>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Node*, std::less<void>)]':
/usr/include/c++/7/bits/stl_algo.h:1674:12:   required from 'void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<std::pair<std::tuple<int, int, int>, std::__cxx11::basic_string<char> >*, std::vector<std::pair<std::tuple<int, int, int>, std::__cxx11::basic_string<char> > > >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<KDTree<std::tuple<int, int, int>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Node* (*)(KDTree<std::tuple<int, int, int>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Node*, KDTree<std::tuple<int, int, int>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Node*, std::less<void>)>]'
/usr/include/c++/7/bits/stl_algo.h:1985:26:   required from 'void std::__introselect(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<std::pair<std::tuple<int, int, int>, std::__cxx11::basic_string<char> >*, std::vector<std::pair<std::tuple<int, int, int>, std::__cxx11::basic_string<char> > > >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<KDTree<std::tuple<int, int, int>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Node* (*)(KDTree<std::tuple<int, int, int>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Node*, KDTree<std::tuple<int, int, int>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Node*, std::less<void>)>]'
/usr/include/c++/7/bits/stl_algo.h:4805:25:   required from 'void std::nth_element(_RAIter, _RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator<std::pair<std::tuple<int, int, int>, std::__cxx11::basic_string<char> >*, std::vector<std::pair<std::tuple<int, int, int>, std::__cxx11::basic_string<char> > > >; _Compare = KDTree<std::tuple<int, int, int>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Node* (*)(KDTree<std::tuple<int, int, int>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Node*, KDTree<std::tuple<int, int, int>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Node*, std::less<void>)]'
/in/kdtree.hpp:428:25:   required from 'KDTree<std::tuple<_Elements ...>, ValueType>::Node* KDTree<std::tuple<_Elements ...>, ValueType>::build_helper(std::vector<std::pair<std::tuple<_Elements ...>, ValueType> >, KDTree<std::tuple<_Elements ...>, ValueType>::Node*) [with long unsigned int DIM = 0; ValueType = std::__cxx11::basic_string<char>; KeyTypes = {int, int, int}]'
/in/kdtree.hpp:461:37:   required from 'KDTree<std::tuple<_Elements ...>, ValueType>::KDTree(std::vector<std::pair<std::tuple<_Elements ...>, ValueType> >) [with ValueType = std::__cxx11::basic_string<char>; KeyTypes = {int, int, int}]'
/in/driver/main.cpp:43:57:   required from here
/usr/include/c++/7/bits/predefined_ops.h:143:18: error: cannot convert 'std::pair<std::tuple<int, int, int>, std::__cxx11::basic_string<char> >' to 'KDTree<std::tuple<int, int, int>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Node*' in argument passing
         { return bool(_M_comp(*__it1, *__it2)); }
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/7/bits/predefined_ops.h: In instantiation of 'bool __gnu_cxx::__ops::_Val_comp_iter<_Compare>::operator()(_Value&, _Iterator) [with _Value = std::pair<std::tuple<int, int, int>, std::__cxx11::basic_string<char> >; _Iterator = __gnu_cxx::__normal_iterator<std::pair<std::tuple<int, int, int>, std::__cxx11::basic_string<char> >*, std::vector<std::pair<std::tuple<int, int, int>, std::__cxx11::basic_string<char> > > >; _Compare = KDTree<std::tuple<int, int, int>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Node* (*)(KDTree<std::tuple<int, int, int>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Node*, KDTree<std::tuple<int, int, int>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Node*, std::less<void>)]':
/usr/include/c++/7/bits/stl_algo.h:1828:20:   required from 'void std::__unguarded_linear_insert(_RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<std::pair<std::tuple<int, int, int>, std::__cxx11::basic_string<char> >*, std::vector<std::pair<std::tuple<int, int, int>, std::__cxx11::basic_string<char> > > >; _Compare = __gnu_cxx::__ops::_Val_comp_iter<KDTree<std::tuple<int, int, int>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Node* (*)(KDTree<std::tuple<int, int, int>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Node*, KDTree<std::tuple<int, int, int>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Node*, std::less<void>)>]'
/usr/include/c++/7/bits/stl_algo.h:1855:36:   required from 'void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<std::pair<std::tuple<int, int, int>, std::__cxx11::basic_string<char> >*, std::vector<std::pair<std::tuple<int, int, int>, std::__cxx11::basic_string<char> > > >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<KDTree<std::tuple<int, int, int>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Node* (*)(KDTree<std::tuple<int, int, int>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Node*, KDTree<std::tuple<int, int, int>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Node*, std::less<void>)>]'
/usr/include/c++/7/bits/stl_algo.h:1998:28:   required from 'void std::__introselect(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<std::pair<std::tuple<int, int, int>, std::__cxx11::basic_string<char> >*, std::vector<std::pair<std::tuple<int, int, int>, std::__cxx11::basic_string<char> > > >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<KDTree<std::tuple<int, int, int>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Node* (*)(KDTree<std::tuple<int, int, int>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Node*, KDTree<std::tuple<int, int, int>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Node*, std::less<void>)>]'
/usr/include/c++/7/bits/stl_algo.h:4805:25:   required from 'void std::nth_element(_RAIter, _RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator<std::pair<std::tuple<int, int, int>, std::__cxx11::basic_string<char> >*, std::vector<std::pair<std::tuple<int, int, int>, std::__cxx11::basic_string<char> > > >; _Compare = KDTree<std::tuple<int, int, int>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Node* (*)(KDTree<std::tuple<int, int, int>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Node*, KDTree<std::tuple<int, int, int>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Node*, std::less<void>)]'
/in/kdtree.hpp:428:25:   required from 'KDTree<std::tuple<_Elements ...>, ValueType>::Node* KDTree<std::tuple<_Elements ...>, ValueType>::build_helper(std::vector<std::pair<std::tuple<_Elements ...>, ValueType> >, KDTree<std::tuple<_Elements ...>, ValueType>::Node*) [with long unsigned int DIM = 0; ValueType = std::__cxx11::basic_string<char>; KeyTypes = {int, int, int}]'
/in/kdtree.hpp:461:37:   required from 'KDTree<std::tuple<_Elements ...>, ValueType>::KDTree(std::vector<std::pair<std::tuple<_Elements ...>, ValueType> >) [with ValueType = std::__cxx11::basic_string<char>; KeyTypes = {int, int, int}]'
/in/driver/main.cpp:43:57:   required from here
/usr/include/c++/7/bits/predefined_ops.h:215:11: error: cannot convert 'std::pair<std::tuple<int, int, int>, std::__cxx11::basic_string<char> >' to 'KDTree<std::tuple<int, int, int>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Node*' in argument passing
  { return bool(_M_comp(__val, *__it)); }
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/7/bits/predefined_ops.h: In instantiation of 'bool __gnu_cxx::__ops::_Iter_comp_val<_Compare>::operator()(_Iterator, _Value&) [with _Iterator = __gnu_cxx::__normal_iterator<std::pair<std::tuple<int, int, int>, std::__cxx11::basic_string<char> >*, std::vector<std::pair<std::tuple<int, int, int>, std::__cxx11::basic_string<char> > > >; _Value = std::pair<std::tuple<int, int, int>, std::__cxx11::basic_string<char> >; _Compare = KDTree<std::tuple<int, int, int>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Node* (*)(KDTree<std::tuple<int, int, int>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Node*, KDTree<std::tuple<int, int, int>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Node*, std::less<void>)]':
/usr/include/c++/7/bits/stl_heap.h:133:48:   required from 'void std::__push_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare&) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<std::pair<std::tuple<int, int, int>, std::__cxx11::basic_string<char> >*, std::vector<std::pair<std::tuple<int, int, int>, std::__cxx11::basic_string<char> > > >; _Distance = long int; _Tp = std::pair<std::tuple<int, int, int>, std::__cxx11::basic_string<char> >; _Compare = __gnu_cxx::__ops::_Iter_comp_val<KDTree<std::tuple<int, int, int>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Node* (*)(KDTree<std::tuple<int, int, int>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Node*, KDTree<std::tuple<int, int, int>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Node*, std::less<void>)>]'
/usr/include/c++/7/bits/stl_heap.h:237:23:   required from 'void std::__adjust_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<std::pair<std::tuple<int, int, int>, std::__cxx11::basic_string<char> >*, std::vector<std::pair<std::tuple<int, int, int>, std::__cxx11::basic_string<char> > > >; _Distance = long int; _Tp = std::pair<std::tuple<int, int, int>, std::__cxx11::basic_string<char> >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<KDTree<std::tuple<int, int, int>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Node* (*)(KDTree<std::tuple<int, int, int>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Node*, KDTree<std::tuple<int, int, int>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Node*, std::less<void>)>]'
/usr/include/c++/7/bits/stl_heap.h:342:22:   required from 'void std::__make_heap(_RandomAccessIterator, _RandomAccessIterator, _Compare&) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<std::pair<std::tuple<int, int, int>, std::__cxx11::basic_string<char> >*, std::vector<std::pair<std::tuple<int, int, int>, std::__cxx11::basic_string<char> > > >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<KDTree<std::tuple<int, int, int>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Node* (*)(KDTree<std::tuple<int, int, int>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Node*, KDTree<std::tuple<int, int, int>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Node*, std::less<void>)>]'
/usr/include/c++/7/bits/stl_algo.h:1672:23:   required from 'void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<std::pair<std::tuple<int, int, int>, std::__cxx11::basic_string<char> >*, std::vector<std::pair<std::tuple<int, int, int>, std::__cxx11::basic_string<char> > > >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<KDTree<std::tuple<int, int, int>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Node* (*)(KDTree<std::tuple<int, int, int>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Node*, KDTree<std::tuple<int, int, int>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Node*, std::less<void>)>]'
/usr/include/c++/7/bits/stl_algo.h:1985:26:   required from 'void std::__introselect(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<std::pair<std::tuple<int, int, int>, std::__cxx11::basic_string<char> >*, std::vector<std::pair<std::tuple<int, int, int>, std::__cxx11::basic_string<char> > > >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<KDTree<std::tuple<int, int, int>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Node* (*)(KDTree<std::tuple<int, int, int>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Node*, KDTree<std::tuple<int, int, int>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Node*, std::less<void>)>]'
/usr/include/c++/7/bits/stl_algo.h:4805:25:   required from 'void std::nth_element(_RAIter, _RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator<std::pair<std::tuple<int, int, int>, std::__cxx11::basic_string<char> >*, std::vector<std::pair<std::tuple<int, int, int>, std::__cxx11::basic_string<char> > > >; _Compare = KDTree<std::tuple<int, int, int>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Node* (*)(KDTree<std::tuple<int, int, int>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Node*, KDTree<std::tuple<int, int, int>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Node*, std::less<void>)]'
/in/kdtree.hpp:428:25:   required from 'KDTree<std::tuple<_Elements ...>, ValueType>::Node* KDTree<std::tuple<_Elements ...>, ValueType>::build_helper(std::vector<std::pair<std::tuple<_Elements ...>, ValueType> >, KDTree<std::tuple<_Elements ...>, ValueType>::Node*) [with long unsigned int DIM = 0; ValueType = std::__cxx11::basic_string<char>; KeyTypes = {int, int, int}]'
/in/kdtree.hpp:461:37:   required from 'KDTree<std::tuple<_Elements ...>, ValueType>::KDTree(std::vector<std::pair<std::tuple<_Elements ...>, ValueType> >) [with ValueType = std::__cxx11::basic_string<char>; KeyTypes = {int, int, int}]'
/in/driver/main.cpp:43:57:   required from here
/usr/include/c++/7/bits/predefined_ops.h:177:11: error: cannot convert 'std::pair<std::tuple<int, int, int>, std::__cxx11::basic_string<char> >' to 'KDTree<std::tuple<int, int, int>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Node*' in argument passing
  { return bool(_M_comp(*__it, __val)); }
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /in/driver/main.cpp:8:0:
/in/kdtree.hpp: In member function 'bool KDTree<std::tuple<_Elements ...>, ValueType>::insert(const Key&, const Value&, KDTree<std::tuple<_Elements ...>, ValueType>::Node*&, KDTree<std::tuple<_Elements ...>, ValueType>::Node*) [with long unsigned int DIM = 0; ValueType = std::__cxx11::basic_string<char>; KeyTypes = {int, int, int}]':
/in/kdtree.hpp:241:5: error: control reaches end of non-void function [-Werror=return-type]
     }
     ^
/in/kdtree.hpp: In member function 'bool KDTree<std::tuple<_Elements ...>, ValueType>::insert(const Key&, const Value&, KDTree<std::tuple<_Elements ...>, ValueType>::Node*&, KDTree<std::tuple<_Elements ...>, ValueType>::Node*) [with long unsigned int DIM = 1; ValueType = std::__cxx11::basic_string<char>; KeyTypes = {int, int, int}]':
/in/kdtree.hpp:241:5: error: control reaches end of non-void function [-Werror=return-type]
     }
     ^
/in/kdtree.hpp: In member function 'bool KDTree<std::tuple<_Elements ...>, ValueType>::insert(const Key&, const Value&, KDTree<std::tuple<_Elements ...>, ValueType>::Node*&, KDTree<std::tuple<_Elements ...>, ValueType>::Node*) [with long unsigned int DIM = 2; ValueType = std::__cxx11::basic_string<char>; KeyTypes = {int, int, int}]':
/in/kdtree.hpp:241:5: error: control reaches end of non-void function [-Werror=return-type]
     }
     ^
cc1plus: all warnings being treated as errors

Information

Submit By
Type
Submission
Homework
Project 3
Language
C++
Submit At
2024-07-27 23:55:25
Judged At
2024-07-27 23:55:25
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes