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>& KDTree<std::tuple<_Elements ...>, ValueType>::operator=(const KDTree<std::tuple<_Elements ...>, ValueType>&)':
/in/kdtree.hpp:468:13: error: return-statement with no value, in function returning 'KDTree<std::tuple<_Elements ...>, ValueType>&' [-fpermissive]
             return;
             ^~~~~~
/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:468:13: error: return-statement with no value, in function returning 'KDTree<std::tuple<int, int, int>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >&' [-fpermissive]
/in/kdtree.hpp: In instantiation of 'KDTree<std::tuple<_Elements ...>, ValueType>::Node* KDTree<std::tuple<_Elements ...>, ValueType>::CopyMethod(std::vector<std::pair<std::tuple<_Elements ...>, ValueType> >, int, int, 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:447:35:   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:418:45: 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> > >::CopyMethod<DIM_NEXT>(std::vector<std::pair<std::tuple<int, int, int>, std::__cxx11::basic_string<char> > >&, int&, int, KDTree<std::tuple<int, int, int>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Node*&)'
         newNode->left = CopyMethod<DIM_NEXT>(temp, a, c - 1, newNode);
                         ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
/in/kdtree.hpp:409:11: note: candidate: template<long unsigned int DIM> KDTree<std::tuple<_Elements ...>, ValueType>::Node* KDTree<std::tuple<_Elements ...>, ValueType>::CopyMethod(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* CopyMethod(std::vector<std::pair<Key, Value>> temp, int a, int b, Node* node1)
           ^~~~~~~~~~
/in/kdtree.hpp:409:11: note:   template argument deduction/substitution failed:
/in/kdtree.hpp:418:45: error: the value of 'DIM_NEXT' is not usable in a constant expression
         newNode->left = CopyMethod<DIM_NEXT>(temp, a, c - 1, newNode);
                         ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
/in/kdtree.hpp:414:14: note: 'long unsigned int DIM_NEXT' is not const
         auto DIM_NEXT = (DIM + 1) % KeySize;
              ^~~~~~~~
/in/kdtree.hpp:418:45: note: in template argument for type 'long unsigned int' 
         newNode->left = CopyMethod<DIM_NEXT>(temp, a, c - 1, newNode);
                         ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
/in/kdtree.hpp:419:46: 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> > >::CopyMethod<DIM_NEXT>(std::vector<std::pair<std::tuple<int, int, int>, std::__cxx11::basic_string<char> > >&, int, int&, KDTree<std::tuple<int, int, int>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Node*&)'
         newNode->right = CopyMethod<DIM_NEXT>(temp, c + 1, b, newNode);
                          ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
/in/kdtree.hpp:409:11: note: candidate: template<long unsigned int DIM> KDTree<std::tuple<_Elements ...>, ValueType>::Node* KDTree<std::tuple<_Elements ...>, ValueType>::CopyMethod(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* CopyMethod(std::vector<std::pair<Key, Value>> temp, int a, int b, Node* node1)
           ^~~~~~~~~~
/in/kdtree.hpp:409:11: note:   template argument deduction/substitution failed:
/in/kdtree.hpp:419:46: error: the value of 'DIM_NEXT' is not usable in a constant expression
         newNode->right = CopyMethod<DIM_NEXT>(temp, c + 1, b, newNode);
                          ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
/in/kdtree.hpp:414:14: note: 'long unsigned int DIM_NEXT' is not const
         auto DIM_NEXT = (DIM + 1) % KeySize;
              ^~~~~~~~
/in/kdtree.hpp:419:46: note: in template argument for type 'long unsigned int' 
         newNode->right = CopyMethod<DIM_NEXT>(temp, c + 1, b, newNode);
                          ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~

Information

Submit By
Type
Submission
Homework
Project 3
Language
C++
Submit At
2022-07-11 14:24:49
Judged At
2022-07-11 14:24:49
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes