Record Detail

Compile Error

In file included from /in/driver/main.cpp:8:0:
/in/kdtree.hpp: In instantiation of 'static bool KDTree<std::tuple<_Elements ...>, ValueType>::equal(const std::pair<std::tuple<_Elements ...>, ValueType>&, const std::pair<std::tuple<_Elements ...>, ValueType>&) [with long unsigned int DIM = 0; ValueType = std::__cxx11::basic_string<char>; KeyTypes = {int, int, int}]':
/in/kdtree.hpp:408:34:   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
/in/kdtree.hpp:361:17: error: no matching function for call to 'KDTree<std::tuple<int, int, int>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::comp(const std::pair<std::tuple<int, int, int>, std::__cxx11::basic_string<char> >&, const std::pair<std::tuple<int, int, int>, std::__cxx11::basic_string<char> >&)'
         if(!comp(a,b) && !comp(b,a)) return true;
             ~~~~^~~~~
/in/kdtree.hpp:355:17: note: candidate: template<long unsigned int DIM> static bool KDTree<std::tuple<_Elements ...>, ValueType>::comp(const std::pair<std::tuple<_Elements ...>, ValueType>&, const std::pair<std::tuple<_Elements ...>, ValueType>&) [with long unsigned int DIM = DIM; ValueType = std::__cxx11::basic_string<char>; KeyTypes = {int, int, int}]
     static bool comp(const std::pair<Key, Value> &a, const std::pair<Key, Value> &b) {
                 ^~~~
/in/kdtree.hpp:355:17: note:   template argument deduction/substitution failed:
/in/kdtree.hpp:361:17: note:   couldn't deduce template parameter 'DIM'
         if(!comp(a,b) && !comp(b,a)) return true;
             ~~~~^~~~~
/in/kdtree.hpp:361:31: error: no matching function for call to 'KDTree<std::tuple<int, int, int>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::comp(const std::pair<std::tuple<int, int, int>, std::__cxx11::basic_string<char> >&, const std::pair<std::tuple<int, int, int>, std::__cxx11::basic_string<char> >&)'
         if(!comp(a,b) && !comp(b,a)) return true;
                           ~~~~^~~~~
/in/kdtree.hpp:355:17: note: candidate: template<long unsigned int DIM> static bool KDTree<std::tuple<_Elements ...>, ValueType>::comp(const std::pair<std::tuple<_Elements ...>, ValueType>&, const std::pair<std::tuple<_Elements ...>, ValueType>&) [with long unsigned int DIM = DIM; ValueType = std::__cxx11::basic_string<char>; KeyTypes = {int, int, int}]
     static bool comp(const std::pair<Key, Value> &a, const std::pair<Key, Value> &b) {
                 ^~~~
/in/kdtree.hpp:355:17: note:   template argument deduction/substitution failed:
/in/kdtree.hpp:361:31: note:   couldn't deduce template parameter 'DIM'
         if(!comp(a,b) && !comp(b,a)) return true;
                           ~~~~^~~~~
/in/kdtree.hpp: In instantiation of 'KDTree<std::tuple<_Elements ...>, ValueType>::Node* KDTree<std::tuple<_Elements ...>, ValueType>::constructor(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:410:34:   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
/in/kdtree.hpp:370:25: error: no matching function for call to 'nth_element(std::vector<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> > > >&, std::vector<std::pair<std::tuple<int, int, int>, std::__cxx11::basic_string<char> > >::iterator, <unresolved overloaded function type>)'
         std::nth_element(v.begin(), median, v.end(),comp);
         ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/7/algorithm:62:0,
                 from /in/kdtree.hpp:3,
                 from /in/driver/main.cpp:8:
/usr/include/c++/7/bits/stl_algo.h:4750:5: note: candidate: template<class _RAIter> void std::nth_element(_RAIter, _RAIter, _RAIter)
     nth_element(_RandomAccessIterator __first, _RandomAccessIterator __nth,
     ^~~~~~~~~~~
/usr/include/c++/7/bits/stl_algo.h:4750:5: note:   template argument deduction/substitution failed:
In file included from /in/driver/main.cpp:8:0:
/in/kdtree.hpp:370:25: note:   candidate expects 3 arguments, 4 provided
         std::nth_element(v.begin(), median, v.end(),comp);
         ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/7/algorithm:62:0,
                 from /in/kdtree.hpp:3,
                 from /in/driver/main.cpp:8:
/usr/include/c++/7/bits/stl_algo.h:4789:5: note: candidate: 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 = bool (*)(const std::pair<std::tuple<int, int, int>, std::__cxx11::basic_string<char> >&, const std::pair<std::tuple<int, int, int>, std::__cxx11::basic_string<char> >&)]
     nth_element(_RandomAccessIterator __first, _RandomAccessIterator __nth,
     ^~~~~~~~~~~
/usr/include/c++/7/bits/stl_algo.h:4789:5: note:   no known conversion for argument 4 from '<unresolved overloaded function type>' to 'bool (*)(const std::pair<std::tuple<int, int, int>, std::__cxx11::basic_string<char> >&, const std::pair<std::tuple<int, int, int>, std::__cxx11::basic_string<char> >&)'
In file included from /in/driver/main.cpp:8:0:
/in/kdtree.hpp:371:45: error: no match for 'operator[]' (operand types are 'std::vector<std::pair<std::tuple<int, int, int>, std::__cxx11::basic_string<char> > >' and '__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> > > >')
         std::pair<Key, Value> medianNode = v[median];
                                            ~^
In file included from /usr/include/c++/7/vector:64:0,
                 from /in/kdtree.hpp:2,
                 from /in/driver/main.cpp:8:
/usr/include/c++/7/bits/stl_vector.h:795:7: note: candidate: std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](std::vector<_Tp, _Alloc>::size_type) [with _Tp = std::pair<std::tuple<int, int, int>, std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<std::tuple<int, int, int>, std::__cxx11::basic_string<char> > >; std::vector<_Tp, _Alloc>::reference = std::pair<std::tuple<int, int, int>, std::__cxx11::basic_string<char> >&; std::vector<_Tp, _Alloc>::size_type = long unsigned int]
       operator[](size_type __n) _GLIBCXX_NOEXCEPT
       ^~~~~~~~
/usr/include/c++/7/bits/stl_vector.h:795:7: note:   no known conversion for argument 1 from '__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> > > >' to 'std::vector<std::pair<std::tuple<int, int, int>, std::__cxx11::basic_string<char> > >::size_type {aka long unsigned int}'
/usr/include/c++/7/bits/stl_vector.h:813:7: note: candidate: std::vector<_Tp, _Alloc>::const_reference std::vector<_Tp, _Alloc>::operator[](std::vector<_Tp, _Alloc>::size_type) const [with _Tp = std::pair<std::tuple<int, int, int>, std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<std::tuple<int, int, int>, std::__cxx11::basic_string<char> > >; std::vector<_Tp, _Alloc>::const_reference = const std::pair<std::tuple<int, int, int>, std::__cxx11::basic_string<char> >&; std::vector<_Tp, _Alloc>::size_type = long unsigned int]
       operator[](size_type __n) const _GLIBCXX_NOEXCEPT
       ^~~~~~~~
/usr/include/c++/7/bits/stl_vector.h:813:7: note:   no known conversion for argument 1 from '__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> > > >' to 'std::vector<std::pair<std::tuple<int, int, int>, std::__cxx11::basic_string<char> > >::size_type {aka long unsigned int}'
In file included from /in/driver/main.cpp:8:0:
/in/kdtree.hpp: In instantiation of 'void KDTree<std::tuple<_Elements ...>, ValueType>::destructor(KDTree<std::tuple<_Elements ...>, ValueType>::Node*) [with ValueType = std::__cxx11::basic_string<char>; KeyTypes = {int, int, int}]':
/in/kdtree.hpp:442:19:   required from 'KDTree<std::tuple<_Elements ...>, ValueType>::~KDTree() [with ValueType = std::__cxx11::basic_string<char>; KeyTypes = {int, int, int}]'
/in/driver/main.cpp:43:57:   required from here
/in/kdtree.hpp:393:35: error: 'destructpr' was not declared in this scope
         if (node->right)destructpr(node->right);
                         ~~~~~~~~~~^~~~~~~~~~~~~
/in/kdtree.hpp:393:35: note: suggested alternative: 'destructor'
         if (node->right)destructpr(node->right);
                         ~~~~~~~~~~^~~~~~~~~~~~~
                         destructor
/in/kdtree.hpp: In instantiation of '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}; KDTree<std::tuple<_Elements ...>, ValueType>::Key = std::tuple<int, int, int>; KDTree<std::tuple<_Elements ...>, ValueType>::Value = std::__cxx11::basic_string<char>]':
/in/kdtree.hpp:461:18:   required from 'void KDTree<std::tuple<_Elements ...>, ValueType>::insert(const Key&, const Value&) [with ValueType = std::__cxx11::basic_string<char>; KeyTypes = {int, int, int}; KDTree<std::tuple<_Elements ...>, ValueType>::Key = std::tuple<int, int, int>; KDTree<std::tuple<_Elements ...>, ValueType>::Value = std::__cxx11::basic_string<char>]'
/in/driver/main.cpp:65:37:   required from here
/in/kdtree.hpp:196:25: error: invalid use of member function '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>]' (did you forget the '()' ?)
             node->value = value;
             ~~~~~~~~~~~~^~~~~~~

Information

Submit By
Type
Submission
Homework
Project 3: K-D tree
Language
C++
Submit At
2022-11-30 02:07:03
Judged At
2022-11-30 02:07:03
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes