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>::TreeInit(std::vector<std::pair<std::tuple<_Elements ...>, ValueType> >, int, int, KDTree<std::tuple<_Elements ...>, ValueType>::Node*)':
/in/kdtree.hpp:516:43: error: declaration of 'std::vector<std::pair<std::tuple<_Elements ...>, ValueType> > left' shadows a parameter
   std::vector<std::pair<Key, Value>> left(v.begin(), m);
                                           ^
/in/kdtree.hpp:517:44: error: declaration of 'std::vector<std::pair<std::tuple<_Elements ...>, ValueType> > right' shadows a parameter
   std::vector<std::pair<Key, Value>> right(m + 1, v.end());
                                            ^
/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:556:22: 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> > >::TreeInit<0>(std::vector<std::pair<std::tuple<int, int, int>, std::__cxx11::basic_string<char> > >&, std::nullptr_t)'
    root = TreeInit<0>(v, nullptr);
           ~~~~~~~~~~~^~~~~~~~~~~~
In file included from /in/driver/main.cpp:8:0:
/in/kdtree.hpp:490:8: note: candidate: template<long unsigned int DIM> KDTree<std::tuple<_Elements ...>, ValueType>::Node* KDTree<std::tuple<_Elements ...>, ValueType>::TreeInit(std::vector<std::pair<std::tuple<_Elements ...>, ValueType> >, int, int, KDTree<std::tuple<_Elements ...>, ValueType>::Node*) [with long unsigned int DIM = DIM; ValueType = std::__cxx11::basic_string<char>; KeyTypes = {int, int, int}]
  Node *TreeInit(std::vector<std::pair<Key, Value>> v, int left, int right, Node* parent)
        ^~~~~~~~
/in/kdtree.hpp:490:8: note:   template argument deduction/substitution failed:
In file included from /in/driver/main.cpp:8:0:
/in/kdtree.hpp:556:22: note:   candidate expects 4 arguments, 2 provided
    root = TreeInit<0>(v, nullptr);
           ~~~~~~~~~~~^~~~~~~~~~~~

Information

Submit By
Type
Submission
Homework
Project 3
Language
C++
Submit At
2021-11-26 19:19:35
Judged At
2021-11-26 19:19:35
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes