Record Detail

Compile Error

In file included from /in/driver/main.cpp:8:0:
/in/kdtree.hpp: In member function 'KDTree<std::tuple<_Elements ...>, ValueType>::Node* KDTree<std::tuple<_Elements ...>, ValueType>::findMax(KDTree<std::tuple<_Elements ...>, ValueType>::Node*)':
/in/kdtree.hpp:277:53: error: 'min' was not declared in this scope
             max = compareNode<DIM_CMP, std::less<>>(min, leftMax);
                                                     ^~~
/in/kdtree.hpp:277:53: note: suggested alternative:
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:3456:5: note:   'std::min'
     min(initializer_list<_Tp> __l, _Compare __comp)
     ^~~
In file included from /in/driver/main.cpp:8:0:
/in/kdtree.hpp: In member function 'KDTree<std::tuple<_Elements ...>, ValueType>::Node* KDTree<std::tuple<_Elements ...>, ValueType>::erase(KDTree<std::tuple<_Elements ...>, ValueType>::Node*, const Key&)':
/in/kdtree.hpp:337:17: error: 'compareKeyAtDIM' was not declared in this scope
             if (compareKeyAtDIM<DIM, std::less<>>(key, node->key())) node->left = erase<DIM_NEXT>(node->left, key);
                 ^~~~~~~~~~~~~~~
/in/kdtree.hpp:337:17: note: suggested alternative: 'compareKey'
             if (compareKeyAtDIM<DIM, std::less<>>(key, node->key())) node->left = erase<DIM_NEXT>(node->left, key);
                 ^~~~~~~~~~~~~~~
                 compareKey
/in/kdtree.hpp:337:48: error: expected primary-expression before '>' token
             if (compareKeyAtDIM<DIM, std::less<>>(key, node->key())) node->left = erase<DIM_NEXT>(node->left, key);
                                                ^~
/in/kdtree.hpp: In instantiation of '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:409: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> > >::constructor(std::vector<std::pair<std::tuple<int, int, int>, std::__cxx11::basic_string<char> > >&, std::nullptr_t)'
             root = constructor(v,nullptr);
                    ~~~~~~~~~~~^~~~~~~~~~~
/in/kdtree.hpp:366:11: note: candidate: template<long unsigned int DIM> 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 = DIM; ValueType = std::__cxx11::basic_string<char>; KeyTypes = {int, int, int}]
     Node* constructor(std::vector<std::pair<Key, Value>> v, Node* parent){
           ^~~~~~~~~~~
/in/kdtree.hpp:366:11: note:   template argument deduction/substitution failed:
/in/kdtree.hpp:409:31: note:   couldn't deduce template parameter 'DIM'
             root = constructor(v,nullptr);
                    ~~~~~~~~~~~^~~~~~~~~~~
/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:407: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 '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:441: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:392:35: error: 'destructpr' was not declared in this scope
         if (node->right)destructpr(node->right);
                         ~~~~~~~~~~^~~~~~~~~~~~~
/in/kdtree.hpp:392: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:460: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;
             ~~~~~~~~~~~~^~~~~~~
/in/kdtree.hpp: In instantiation of 'KDTree<std::tuple<_Elements ...>, ValueType>::Node* KDTree<std::tuple<_Elements ...>, ValueType>::erase(KDTree<std::tuple<_Elements ...>, ValueType>::Node*, const Key&) [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>]':
/in/kdtree.hpp:483:17:   required from 'bool KDTree<std::tuple<_Elements ...>, ValueType>::erase(const Key&) [with ValueType = std::__cxx11::basic_string<char>; KeyTypes = {int, int, int}; KDTree<std::tuple<_Elements ...>, ValueType>::Key = std::tuple<int, int, int>]'
/in/driver/main.cpp:105:33:   required from here
/in/kdtree.hpp:337:54: error: left operand of comma operator has no effect [-Werror=unused-value]
             if (compareKeyAtDIM<DIM, std::less<>>(key, node->key())) node->left = erase<DIM_NEXT>(node->left, key);
                                                  ~~~~^~~~~~~~~~~~~~
/in/kdtree.hpp: In instantiation of 'KDTree<std::tuple<_Elements ...>, ValueType>::Node* KDTree<std::tuple<_Elements ...>, ValueType>::findMax(KDTree<std::tuple<_Elements ...>, ValueType>::Node*) [with long unsigned int DIM_CMP = 0; long unsigned int DIM = 0; ValueType = std::__cxx11::basic_string<char>; KeyTypes = {int, int, int}]':
/in/kdtree.hpp:298:47:   required from 'KDTree<std::tuple<_Elements ...>, ValueType>::Node* KDTree<std::tuple<_Elements ...>, ValueType>::findMaxDynamic(size_t) [with long unsigned int DIM = 0; ValueType = std::__cxx11::basic_string<char>; KeyTypes = {int, int, int}; size_t = long unsigned int]'
/in/kdtree.hpp:478:48:   required from 'KDTree<std::tuple<_Elements ...>, ValueType>::Iterator KDTree<std::tuple<_Elements ...>, ValueType>::findMax(size_t) [with ValueType = std::__cxx11::basic_string<char>; KeyTypes = {int, int, int}; size_t = long unsigned int]'
/in/driver/main.cpp:87:46:   required from here
/in/kdtree.hpp:276:62: error: 'struct KDTree<std::tuple<int, int, int>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Node' has no member named 'leftt'; did you mean 'left'?
             Node *leftMax = findMax<DIM_CMP, DIM_NEXT>(node->leftt);
                                                        ~~~~~~^~~~~
                                                        left
/in/kdtree.hpp: In instantiation of 'KDTree<std::tuple<_Elements ...>, ValueType>::Node* KDTree<std::tuple<_Elements ...>, ValueType>::erase(KDTree<std::tuple<_Elements ...>, ValueType>::Node*, const Key&) [with long unsigned int DIM = 1; ValueType = std::__cxx11::basic_string<char>; KeyTypes = {int, int, int}; KDTree<std::tuple<_Elements ...>, ValueType>::Key = std::tuple<int, int, int>]':
/in/kdtree.hpp:326:46:   required from 'KDTree<std::tuple<_Elements ...>, ValueType>::Node* KDTree<std::tuple<_Elements ...>, ValueType>::erase(KDTree<std::tuple<_Elements ...>, ValueType>::Node*, const Key&) [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>]'
/in/kdtree.hpp:483:17:   required from 'bool KDTree<std::tuple<_Elements ...>, ValueType>::erase(const Key&) [with ValueType = std::__cxx11::basic_string<char>; KeyTypes = {int, int, int}; KDTree<std::tuple<_Elements ...>, ValueType>::Key = std::tuple<int, int, int>]'
/in/driver/main.cpp:105:33:   required from here
/in/kdtree.hpp:337:54: error: left operand of comma operator has no effect [-Werror=unused-value]
             if (compareKeyAtDIM<DIM, std::less<>>(key, node->key())) node->left = erase<DIM_NEXT>(node->left, key);
                                                  ~~~~^~~~~~~~~~~~~~
/in/kdtree.hpp: In instantiation of 'KDTree<std::tuple<_Elements ...>, ValueType>::Node* KDTree<std::tuple<_Elements ...>, ValueType>::findMax(KDTree<std::tuple<_Elements ...>, ValueType>::Node*) [with long unsigned int DIM_CMP = 0; long unsigned int DIM = 1; ValueType = std::__cxx11::basic_string<char>; KeyTypes = {int, int, int}]':
/in/kdtree.hpp:329:55:   required from 'KDTree<std::tuple<_Elements ...>, ValueType>::Node* KDTree<std::tuple<_Elements ...>, ValueType>::erase(KDTree<std::tuple<_Elements ...>, ValueType>::Node*, const Key&) [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>]'
/in/kdtree.hpp:483:17:   required from 'bool KDTree<std::tuple<_Elements ...>, ValueType>::erase(const Key&) [with ValueType = std::__cxx11::basic_string<char>; KeyTypes = {int, int, int}; KDTree<std::tuple<_Elements ...>, ValueType>::Key = std::tuple<int, int, int>]'
/in/driver/main.cpp:105:33:   required from here
/in/kdtree.hpp:276:62: error: 'struct KDTree<std::tuple<int, int, int>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Node' has no member named 'leftt'; did you mean 'left'?
             Node *leftMax = findMax<DIM_CMP, DIM_NEXT>(node->leftt);
                                                        ~~~~~~^~~~~
                                                        left
/in/kdtree.hpp: In instantiation of 'KDTree<std::tuple<_Elements ...>, ValueType>::Node* KDTree<std::tuple<_Elements ...>, ValueType>::findMax(KDTree<std::tuple<_Elements ...>, ValueType>::Node*) [with long unsigned int DIM_CMP = 1; long unsigned int DIM = 0; ValueType = std::__cxx11::basic_string<char>; KeyTypes = {int, int, int}]':
/in/kdtree.hpp:298:47:   required from 'KDTree<std::tuple<_Elements ...>, ValueType>::Node* KDTree<std::tuple<_Elements ...>, ValueType>::findMaxDynamic(size_t) [with long unsigned int DIM = 1; ValueType = std::__cxx11::basic_string<char>; KeyTypes = {int, int, int}; size_t = long unsigned int]'
/in/kdtree.hpp:299:40:   required from 'KDTree<std::tuple<_Elements ...>, ValueType>::Node* KDTree<std::tuple<_Elements ...>, ValueType>::findMaxDynamic(size_t) [with long unsigned int DIM = 0; ValueType = std::__cxx11::basic_string<char>; KeyTypes = {int, int, int}; size_t = long unsigned int]'
/in/kdtree.hpp:478:48:   required from 'KDTree<std::tuple<_Elements ...>, ValueType>::Iterator KDTree<std::tuple<_Elements ...>, ValueType>::findMax(size_t) [with ValueType = std::__cxx11::basic_string<char>; KeyTypes = {int, int, int}; size_t = long unsigned int]'
/in/driver/main.cpp:87:46:   required from here
/in/kdtree.hpp:276:62: error: 'struct KDTree<std::tuple<int, int, int>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Node' has no member named 'leftt'; did you mean 'left'?
             Node *leftMax = findMax<DIM_CMP, DIM_NEXT>(node->leftt);
                                                        ~~~~~~^~~~~
                                                        left
/in/kdtree.hpp: In instantiation of 'KDTree<std::tuple<_Elements ...>, ValueType>::Node* KDTree<std::tuple<_Elements ...>, ValueType>::erase(KDTree<std::tuple<_Elements ...>, ValueType>::Node*, const Key&) [with long unsigned int DIM = 2; ValueType = std::__cxx11::basic_string<char>; KeyTypes = {int, int, int}; KDTree<std::tuple<_Elements ...>, ValueType>::Key = std::tuple<int, int, int>]':
/in/kdtree.hpp:326:46:   recursively required from 'KDTree<std::tuple<_Elements ...>, ValueType>::Node* KDTree<std::tuple<_Elements ...>, ValueType>::erase(KDTree<std::tuple<_Elements ...>, ValueType>::Node*, const Key&) [with long unsigned int DIM = 1; ValueType = std::__cxx11::basic_string<char>; KeyTypes = {int, int, int}; KDTree<std::tuple<_Elements ...>, ValueType>::Key = std::tuple<int, int, int>]'
/in/kdtree.hpp:326:46:   required from 'KDTree<std::tuple<_Elements ...>, ValueType>::Node* KDTree<std::tuple<_Elements ...>, ValueType>::erase(KDTree<std::tuple<_Elements ...>, ValueType>::Node*, const Key&) [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>]'
/in/kdtree.hpp:483:17:   required from 'bool KDTree<std::tuple<_Elements ...>, ValueType>::erase(const Key&) [with ValueType = std::__cxx11::basic_string<char>; KeyTypes = {int, int, int}; KDTree<std::tuple<_Elements ...>, ValueType>::Key = std::tuple<int, int, int>]'
/in/driver/main.cpp:105:33:   required from here
/in/kdtree.hpp:337:54: error: left operand of comma operator has no effect [-Werror=unused-value]
             if (compareKeyAtDIM<DIM, std::less<>>(key, node->key())) node->left = erase<DIM_NEXT>(node->left, key);
                                                  ~~~~^~~~~~~~~~~~~~
/in/kdtree.hpp: In instantiation of 'KDTree<std::tuple<_Elements ...>, ValueType>::Node* KDTree<std::tuple<_Elements ...>, ValueType>::findMax(KDTree<std::tuple<_Elements ...>, ValueType>::Node*) [with long unsigned int DIM_CMP = 1; long unsigned int DIM = 2; ValueType = std::__cxx11::basic_string<char>; KeyTypes = {int, int, int}]':
/in/kdtree.hpp:329:55:   required from 'KDTree<std::tuple<_Elements ...>, ValueType>::Node* KDTree<std::tuple<_Elements ...>, ValueType>::erase(KDTree<std::tuple<_Elements ...>, ValueType>::Node*, const Key&) [with long unsigned int DIM = 1; ValueType = std::__cxx11::basic_string<char>; KeyTypes = {int, int, int}; KDTree<std::tuple<_Elements ...>, ValueType>::Key = std::tuple<int, int, int>]'
/in/kdtree.hpp:326:46:   required from 'KDTree<std::tuple<_Elements ...>, ValueType>::Node* KDTree<std::tuple<_Elements ...>, ValueType>::erase(KDTree<std::tuple<_Elements ...>, ValueType>::Node*, const Key&) [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>]'
/in/kdtree.hpp:483:17:   required from 'bool KDTree<std::tuple<_Elements ...>, ValueType>::erase(const Key&) [with ValueType = std::__cxx11::basic_string<char>; KeyTypes = {int, int, int}; KDTree<std::tuple<_Elements ...>, ValueType>::Key = std::tuple<int, int, int>]'
/in/driver/main.cpp:105:33:   required from here
/in/kdtree.hpp:276:62: error: 'struct KDTree<std::tuple<int, int, int>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Node' has no member named 'leftt'; did you mean 'left'?
             Node *leftMax = findMax<DIM_CMP, DIM_NEXT>(node->leftt);
                                                        ~~~~~~^~~~~
                                                        left
/in/kdtree.hpp: In instantiation of 'KDTree<std::tuple<_Elements ...>, ValueType>::Node* KDTree<std::tuple<_Elements ...>, ValueType>::findMax(KDTree<std::tuple<_Elements ...>, ValueType>::Node*) [with long unsigned int DIM_CMP = 0; long unsigned int DIM = 2; ValueType = std::__cxx11::basic_string<char>; KeyTypes = {int, int, int}]':
/in/kdtree.hpp:274:47:   required from 'KDTree<std::tuple<_Elements ...>, ValueType>::Node* KDTree<std::tuple<_Elements ...>, ValueType>::findMax(KDTree<std::tuple<_Elements ...>, ValueType>::Node*) [with long unsigned int DIM_CMP = 0; long unsigned int DIM = 1; ValueType = std::__cxx11::basic_string<char>; KeyTypes = {int, int, int}]'
/in/kdtree.hpp:329:55:   required from 'KDTree<std::tuple<_Elements ...>, ValueType>::Node* KDTree<std::tuple<_Elements ...>, ValueType>::erase(KDTree<std::tuple<_Elements ...>, ValueType>::Node*, const Key&) [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>]'
/in/kdtree.hpp:483:17:   required from 'bool KDTree<std::tuple<_Elements ...>, ValueType>::erase(const Key&) [with ValueType = std::__cxx11::basic_string<char>; KeyTypes = {int, int, int}; KDTree<std::tuple<_Elements ...>, ValueType>::Key = std::tuple<int, int, int>]'
/in/driver/main.cpp:105:33:   required from here
/in/kdtree.hpp:276:62: error: 'struct KDTree<std::tuple<int, int, int>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Node' has no member named 'leftt'; did you mean 'left'?
             Node *leftMax = findMax<DIM_CMP, DIM_NEXT>(node->leftt);
                                                        ~~~~~~^~~~~
            

Information

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