Record Detail

Compile Error

In file included from /in/driver/main.cpp:8:0:
/in/kdtree.hpp:397:22: error: 'std::vector<std::pair<std::tuple<_Elements ...>, ValueType>, std::allocator<std::pair<std::tuple<_Elements ...>, ValueType> > >::iterator' is not a type
     void KDTree_make(std::vector<std::pair<Key, Value>>::iterator begin, std::vector<std::pair<Key, Value>>::iterator end){
                      ^~~
/in/kdtree.hpp:397:74: error: 'std::vector<std::pair<std::tuple<_Elements ...>, ValueType>, std::allocator<std::pair<std::tuple<_Elements ...>, ValueType> > >::iterator' is not a type
     void KDTree_make(std::vector<std::pair<Key, Value>>::iterator begin, std::vector<std::pair<Key, Value>>::iterator end){
                                                                          ^~~
/in/kdtree.hpp:413:40: error: ISO C++ forbids declaration of 'Data' with no type [-fpermissive]
     static bool check_duplicate(const &Data x, const &Data y){
                                        ^~~~
/in/kdtree.hpp:413:45: error: expected ',' or '...' before 'x'
     static bool check_duplicate(const &Data x, const &Data y){
                                             ^
/in/kdtree.hpp:418:50: error: ISO C++ forbids declaration of 'find_median' with no type [-fpermissive]
     find_median(Data data, Node* parent,int depth){
                                                  ^
/in/kdtree.hpp: In member function 'void KDTree<std::tuple<_Elements ...>, ValueType>::KDTree_make(int, int)':
/in/kdtree.hpp:403:19: error: base operand of '->' is not a pointer
         insert(mid->first, mid->second);
                   ^~
/in/kdtree.hpp:403:31: error: base operand of '->' is not a pointer
         insert(mid->first, mid->second);
                               ^~
/in/kdtree.hpp: In static member function 'static bool KDTree<std::tuple<_Elements ...>, ValueType>::check_sort(const Data&, const Data&)':
/in/kdtree.hpp:410:44: error: 'x' was not declared in this scope
         return std::less<>()(std::get<DIM>(x.first), std::get<DIM>(y.first));
                                            ^
/in/kdtree.hpp:410:68: error: 'y' was not declared in this scope
         return std::less<>()(std::get<DIM>(x.first), std::get<DIM>(y.first));
                                                                    ^
/in/kdtree.hpp: In static member function 'static bool KDTree<std::tuple<_Elements ...>, ValueType>::check_duplicate(const int&)':
/in/kdtree.hpp:414:16: error: 'x' was not declared in this scope
         return x.first == y.first;
                ^
/in/kdtree.hpp:414:27: error: 'y' was not declared in this scope
         return x.first == y.first;
                           ^
/in/kdtree.hpp: In member function 'int KDTree<std::tuple<_Elements ...>, ValueType>::find_median(KDTree<std::tuple<_Elements ...>, ValueType>::Data, KDTree<std::tuple<_Elements ...>, ValueType>::Node*, int)':
/in/kdtree.hpp:420:5: error: no return statement in function returning non-void [-Werror=return-type]
     }
     ^
/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:433:37: error: 'class std::reverse_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> > > > >' has no member named 'end'
         KDTree_make<0>(it.base(),it.end());
                                  ~~~^~~
/in/kdtree.hpp: In instantiation of '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:464:19: 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> > >::destructor(KDTree<std::tuple<int, int, int>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Node*&)'
         destructor(root);
         ~~~~~~~~~~^~~~~~
/in/kdtree.hpp:376:10: note: candidate: template<long unsigned int DIM> void KDTree<std::tuple<_Elements ...>, ValueType>::destructor(KDTree<std::tuple<_Elements ...>, ValueType>::Node*) [with long unsigned int DIM = DIM; ValueType = std::__cxx11::basic_string<char>; KeyTypes = {int, int, int}]
     void destructor(Node* node){
          ^~~~~~~~~~
/in/kdtree.hpp:376:10: note:   template argument deduction/substitution failed:
/in/kdtree.hpp:464:19: note:   couldn't deduce template parameter 'DIM'
         destructor(root);
         ~~~~~~~~~~^~~~~~
/in/kdtree.hpp: In instantiation of '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:442:25: 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> > >::KDTree_copy(KDTree<std::tuple<int, int, int>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Node* const&, std::nullptr_t)'
         root=KDTree_copy(that.root,nullptr);
              ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
/in/kdtree.hpp:386:11: note: candidate: template<long unsigned int DIM> KDTree<std::tuple<_Elements ...>, ValueType>::Node* KDTree<std::tuple<_Elements ...>, ValueType>::KDTree_copy(KDTree<std::tuple<_Elements ...>, ValueType>::Node*, KDTree<std::tuple<_Elements ...>, ValueType>::Node*) [with long unsigned int DIM = DIM; ValueType = std::__cxx11::basic_string<char>; KeyTypes = {int, int, int}]
     Node* KDTree_copy(Node* node, Node* parent){
           ^~~~~~~~~~~
/in/kdtree.hpp:386:11: note:   template argument deduction/substitution failed:
/in/kdtree.hpp:442:25: note:   couldn't deduce template parameter 'DIM'
         root=KDTree_copy(that.root,nullptr);
              ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
/in/kdtree.hpp: In instantiation of 'KDTree<std::tuple<_Elements ...>, ValueType>& KDTree<std::tuple<_Elements ...>, ValueType>::operator=(const KDTree<std::tuple<_Elements ...>, ValueType>&) [with ValueType = std::__cxx11::basic_string<char>; KeyTypes = {int, int, int}]':
/in/driver/main.cpp:146:23:   required from here
/in/kdtree.hpp:453:19: 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> > >::destructor(KDTree<std::tuple<int, int, int>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Node*&)'
         destructor(root);
         ~~~~~~~~~~^~~~~~
/in/kdtree.hpp:376:10: note: candidate: template<long unsigned int DIM> void KDTree<std::tuple<_Elements ...>, ValueType>::destructor(KDTree<std::tuple<_Elements ...>, ValueType>::Node*) [with long unsigned int DIM = DIM; ValueType = std::__cxx11::basic_string<char>; KeyTypes = {int, int, int}]
     void destructor(Node* node){
          ^~~~~~~~~~
/in/kdtree.hpp:376:10: note:   template argument deduction/substitution failed:
/in/kdtree.hpp:453:19: note:   couldn't deduce template parameter 'DIM'
         destructor(root);
         ~~~~~~~~~~^~~~~~
/in/kdtree.hpp:454:25: 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> > >::KDTree_copy(KDTree<std::tuple<int, int, int>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Node* const&, std::nullptr_t)'
         root=KDTree_copy(that.root,nullptr);
              ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
/in/kdtree.hpp:386:11: note: candidate: template<long unsigned int DIM> KDTree<std::tuple<_Elements ...>, ValueType>::Node* KDTree<std::tuple<_Elements ...>, ValueType>::KDTree_copy(KDTree<std::tuple<_Elements ...>, ValueType>::Node*, KDTree<std::tuple<_Elements ...>, ValueType>::Node*) [with long unsigned int DIM = DIM; ValueType = std::__cxx11::basic_string<char>; KeyTypes = {int, int, int}]
     Node* KDTree_copy(Node* node, Node* parent){
           ^~~~~~~~~~~
/in/kdtree.hpp:386:11: note:   template argument deduction/substitution failed:
/in/kdtree.hpp:454:25: note:   couldn't deduce template parameter 'DIM'
         root=KDTree_copy(that.root,nullptr);
              ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
/in/kdtree.hpp: In instantiation of 'static bool KDTree<std::tuple<_Elements ...>, ValueType>::check_sort(const Data&, const Data&) [with long unsigned int DIM = 0; ValueType = std::__cxx11::basic_string<char>; KeyTypes = {int, int, int}; KDTree<std::tuple<_Elements ...>, ValueType>::Data = std::pair<const std::tuple<int, int, int>, std::__cxx11::basic_string<char> >]':
/in/kdtree.hpp:431:27:   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:409:40: error: unused parameter 'a' [-Werror=unused-parameter]
     static bool check_sort(const Data &a, const Data &b) {
                                        ^
/in/kdtree.hpp:409:55: error: unused parameter 'b' [-Werror=unused-parameter]
     static bool check_sort(const Data &a, const Data &b) {
                                                       ^
/in/kdtree.hpp: In instantiation of 'static bool KDTree<std::tuple<_Elements ...>, ValueType>::check_duplicate(const int&) [with ValueType = std::__cxx11::basic_string<char>; KeyTypes = {int, int, int}]':
/in/kdtree.hpp:432:32:   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:413:40: error: unused parameter 'Data' [-Werror=unused-parameter]
     static bool check_duplicate(const &Data x, const &Data y){
                                        ^~~~
/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:506: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:345:38: 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> > >::findMax(KDTree<std::tuple<int, int, int>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Node*&)'
                 Node *maxNode=findMax(node->left);
                               ~~~~~~~^~~~~~~~~~~~
/in/kdtree.hpp:275:11: note: candidate: template<long unsigned int DIM_CMP, long unsigned int DIM> KDTree<std::tuple<_Elements ...>, ValueType>::Node* KDTree<std::tuple<_Elements ...>, ValueType>::findMax(KDTree<std::tuple<_Elements ...>, ValueType>::Node*) [with long unsigned int DIM_CMP = DIM_CMP; long unsigned int DIM = DIM; ValueType = std::__cxx11::basic_string<char>; KeyTypes = {int, int, int}]
     Node *findMax(Node *node) {
           ^~~~~~~
/in/kdtree.hpp:275:11: note:   template argument deduction/substitution failed:
/in/kdtree.hpp:345:38: note:   couldn't deduce template parameter 'DIM_CMP'
                 Node *maxNode=findMax(node->left);
                               ~~~~~~~^~~~~~~~~~~~
/in/kdtree.hpp:496:14: note: candidate: template<long unsigned int DIM> KDTree<std::tuple<_Elements ...>, ValueType>::Iterator KDTree<std::tuple<_Elements ...>, ValueType>::findMax() [with long unsigned int DIM = DIM; ValueType = std::__cxx11::basic_string<char>; KeyTypes = {int, int, int}]
     Iterator findMax() {
              ^~~~~~~
/in/kdtree.hpp:496:14: note:   template argument deduction/substitution failed:
/in/kdtree.hpp:345:38: note:   candidate expects 0 arguments, 1 provided
                 Node *maxNode=findMax(node->left);
                               ~~~~~~~^~~~~~~~~~~~
/in/kdtree.hpp:500:14: note: candidate: 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] <near match>
     Iterator findMax(size_t dim) {
              ^~~~~~~
/in/kdtree.hpp:500:14: note:   conversion of argument 1 would be ill-formed:
/in/kdtree.hpp:345:45: error: invalid conversion from 'KDTree<std::tuple<int, int, int>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Node*' to 'size_t {aka long unsigned int}' [-fpermissive]
                 Node *maxNode=findMax(node->left);
                                       ~~~~~~^~~~
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 = std::reverse_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> > > > >; _Iterator2 = std::reverse_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 = bool (*)(const int&)]':
/usr/include/c++/7/bits/stl_algo.h:974:20:   required from '_ForwardIterator std::__unique(_ForwardIterator, _ForwardIterator, _BinaryPredicate) [with _ForwardIterator = std::reverse_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> > > > >; _BinaryPredicate = __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(const int&)>]'
/usr/include/c++/7/bits/stl_algo.h:1036:27:   required from '_FIter std::unique(_FIter, _FIter, _BinaryPredicate) [with _FIter = std::reverse_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> > > > >; _BinaryPredicate = bool (*)(const int&)]'
/in/kdtree.hpp:432:32:   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: invalid initialization of reference of type 'const int&' from expression of type 'std::pair<std::tuple<int, int, int>, std::__cxx11::basic_string<char> >'
         { return bool(_M_comp(*__it1, *__it2)); }
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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>::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:342:44:   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:506: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:345:38: 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> > >::findMax(KDTree<std::tuple<int, int, int>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Node*&)'
                 Node *maxNode=findMax(node->left);
                               ~~~~~~~^~~~~~~~~~~~
/in/kdtree.hpp:275:11: note: candidate: template<long unsigned int DIM_CMP, long unsigned int DIM> KDTree<std::tuple<_Elements ...>, ValueType>::Node* KDTree<std::tuple<_Elements ...>, ValueType>::findMax(KDTree<std::tuple<_Elements ...>, ValueType>::Node*) [with long unsigned int DIM_CMP = DIM_CMP; long unsigned int DIM = DIM; ValueType = std::__cxx11::basic_string<char>; KeyTypes = {int, int, int}]
     Node *findMax(Node *node) {
           ^~~~~~~
/in/kdtree.hpp:275:11: note:   template argument deduction/substitution failed:
/in/kdtree.hpp:345:38: note:   couldn't deduce template parameter 'DIM_CMP'
                 Node *maxNode=findMax(node->left);
                               ~~~~~~~^~~~~~~~~~~~
/in/kdtree.hpp:496:14: note: candidate: template<long unsigned int DIM> KDTree<std::tuple<_Elements ...>, ValueType>::Iterator KDTree<std::tuple<_Elements ...>, ValueType>::findMax() [with long unsigned int DIM = DIM; ValueType = std::__cxx11::basic_string<char>; KeyTypes = {int, int, int}]
     Iterator findMax() {
              ^~~~~~~
/in/kdtree.hpp:496:14: note:   template argument deduction/substitution failed:
/in/kdtree.hpp:345:38: note:   candidate expects 0 arguments, 1 provided
                 Node *maxNode=findMax(node->left);
                               ~~~~~~~^~~~~~~~~~~~
/in/kdtree.hpp:500:14: note: candidate: 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] <near match>
     Iterator findMax(size_t dim) {
              ^~~~~~~
/in/kdtree.hpp:500:14: note:   conversion of argument 1 would be ill-formed:
/in/kdtree.hpp:345:45: error: invalid conversion from 'KDTree<std::tuple<int, int, int>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Node*' to 'size_t {aka long unsigned int}' [-fpermissive]
                 Node *maxNode=findMax(node->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:342:44:   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:

Information

Submit By
Type
Submission
Homework
Project 3: K-D tree
Language
C++
Submit At
2022-11-17 22:14:35
Judged At
2022-11-17 22:14:35
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes