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>::find(const Key&, KDTree<std::tuple<_Elements ...>, ValueType>::Node*)':
/in/kdtree.hpp:183:9: error: 'get' was not declared in this scope
     if (get<DIM>(key) < get<DIM>(node->key())) {
         ^~~
/in/kdtree.hpp:183:9: note: suggested alternative:
In file included from /in/kdtree.hpp:1:0,
                 from /in/driver/main.cpp:8:
/usr/include/c++/7/tuple:1361:5: note:   'std::get'
     get(const tuple<_Types...>& __t) noexcept
     ^~~
In file included from /in/driver/main.cpp:8:0:
/in/kdtree.hpp: In member function 'bool KDTree<std::tuple<_Elements ...>, ValueType>::insert(const Key&, const Value&, KDTree<std::tuple<_Elements ...>, ValueType>::Node*&, KDTree<std::tuple<_Elements ...>, ValueType>::Node*)':
/in/kdtree.hpp:213:9: error: 'get' was not declared in this scope
     if (get<DIM>(key) < get<DIM>(node->key())) {
         ^~~
/in/kdtree.hpp:213:9: note: suggested alternative:
In file included from /in/kdtree.hpp:1:0,
                 from /in/driver/main.cpp:8:
/usr/include/c++/7/tuple:1361:5: note:   'std::get'
     get(const tuple<_Types...>& __t) noexcept
     ^~~
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:368:13: error: 'get' was not declared in this scope
         if (get<DIM>(key) < get<DIM>(node->key())) {
             ^~~
/in/kdtree.hpp:368:13: note: suggested alternative:
In file included from /in/kdtree.hpp:1:0,
                 from /in/driver/main.cpp:8:
/usr/include/c++/7/tuple:1361:5: note:   'std::get'
     get(const tuple<_Types...>& __t) noexcept
     ^~~
In file included from /in/driver/main.cpp:8:0:
/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:457:16: error: no matching function for call to 'stable_sort(std::vector<std::pair<std::tuple<int, int, int>, std::__cxx11::basic_string<char> > >::iterator, std::vector<std::pair<std::tuple<int, int, int>, std::__cxx11::basic_string<char> > >::iterator, <unresolved overloaded function type>)'
     stable_sort(v.begin(), v.end(), keyComp<0>);
     ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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:5065:5: note: candidate: template<class _RAIter, class _Compare> void std::stable_sort(_RAIter, _RAIter, _Compare)
     stable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
     ^~~~~~~~~~~
/usr/include/c++/7/bits/stl_algo.h:5065:5: note:   template argument deduction/substitution failed:
In file included from /in/driver/main.cpp:8:0:
/in/kdtree.hpp:457:16: note:   couldn't deduce template parameter '_Compare'
     stable_sort(v.begin(), v.end(), keyComp<0>);
     ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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:5031:5: note: candidate: template<class _RAIter> void std::stable_sort(_RAIter, _RAIter)
     stable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
     ^~~~~~~~~~~
/usr/include/c++/7/bits/stl_algo.h:5031:5: note:   template argument deduction/substitution failed:
In file included from /in/driver/main.cpp:8:0:
/in/kdtree.hpp:457:16: note:   candidate expects 2 arguments, 3 provided
     stable_sort(v.begin(), v.end(), keyComp<0>);
     ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/in/kdtree.hpp:461:32: 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> > >::vectorConstruct2tree<0>(std::vector<std::pair<std::tuple<int, int, int>, std::__cxx11::basic_string<char> > >&, int, int, std::nullptr_t)'
         vectorConstruct2tree<0>(v, 0, static_cast<int>(v.size()) - 1, nullptr);
         ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/in/kdtree.hpp:405:7: note: candidate: template<long unsigned int DIM, long unsigned int KeySize> KDTree<std::tuple<_Elements ...>, ValueType>::Node* KDTree<std::tuple<_Elements ...>, ValueType>::vectorConstruct2tree(std::vector<std::pair<std::tuple<_Elements ...>, ValueType> >&, int, int, KDTree<std::tuple<_Elements ...>, ValueType>::Node*) [with long unsigned int DIM = DIM; long unsigned int KeySize = KeySize; ValueType = std::__cxx11::basic_string<char>; KeyTypes = {int, int, int}]
 Node* vectorConstruct2tree(std::vector<std::pair<Key, Value>>& v, int left, int right, Node* parent) {
       ^~~~~~~~~~~~~~~~~~~~
/in/kdtree.hpp:405:7: note:   template argument deduction/substitution failed:
/in/kdtree.hpp:461:32: note:   couldn't deduce template parameter 'KeySize'
         vectorConstruct2tree<0>(v, 0, static_cast<int>(v.size()) - 1, nullptr);
         ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/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:537: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:349:25: error: no match for 'operator=' (operand types are 'const Key {aka const std::tuple<int, int, int>}' and 'const Key {aka const std::tuple<int, int, int>}')
             node->key() = minNode->key();
In file included from /in/kdtree.hpp:1:0,
                 from /in/driver/main.cpp:8:
/usr/include/c++/7/tuple:835:7: note: candidate: std::tuple<_Elements>& std::tuple<_Elements>::operator=(const std::tuple<_Elements>&) [with _Elements = {int, int, int}] <near match>
       operator=(const tuple& __in)
       ^~~~~~~~
/usr/include/c++/7/tuple:835:7: note:   passing 'const Key* {aka const std::tuple<int, int, int>*}' as 'this' argument discards qualifiers
/usr/include/c++/7/tuple:842:7: note: candidate: std::tuple<_Elements>& std::tuple<_Elements>::operator=(std::tuple<_Elements>&&) [with _Elements = {int, int, int}] <near match>
       operator=(tuple&& __in)
       ^~~~~~~~
/usr/include/c++/7/tuple:842:7: note:   conversion of argument 1 would be ill-formed:
In file included from /in/driver/main.cpp:8:0:
/in/kdtree.hpp:349:25: error: cannot bind rvalue reference of type 'std::tuple<int, int, int>&&' to lvalue of type 'const Key {aka const std::tuple<int, int, int>}'
             node->key() = minNode->key();
In file included from /in/kdtree.hpp:1:0,
                 from /in/driver/main.cpp:8:
/usr/include/c++/7/tuple:853:9: note: candidate: typename std::enable_if<(sizeof... (_UElements) == sizeof... (_Elements)), std::tuple<_Elements>&>::type std::tuple<_Elements>::operator=(const std::tuple<_Args1 ...>&) [with _UElements = {int, int, int}; _Elements = {int, int, int}; typename std::enable_if<(sizeof... (_UElements) == sizeof... (_Elements)), std::tuple<_Elements>&>::type = std::tuple<int, int, int>&] <near match>
         operator=(const tuple<_UElements...>& __in)
         ^~~~~~~~
/usr/include/c++/7/tuple:853:9: note:   passing 'const Key* {aka const std::tuple<int, int, int>*}' as 'this' argument discards qualifiers
/usr/include/c++/7/tuple:863:9: note: candidate: template<class ... _UElements> typename std::enable_if<(sizeof... (_UElements) == sizeof... (_Elements)), std::tuple<_Elements>&>::type std::tuple<_Elements>::operator=(std::tuple<_Args1 ...>&&) [with _UElements = {_UElements ...}; _Elements = {int, int, int}]
         operator=(tuple<_UElements...>&& __in)
         ^~~~~~~~
/usr/include/c++/7/tuple:863:9: note:   template argument deduction/substitution failed:
In file included from /in/driver/main.cpp:8:0:
/in/kdtree.hpp:349:25: note:   types 'std::tuple<_Tps ...>' and 'const Key {aka const std::tuple<int, int, int>}' have incompatible cv-qualifiers
             node->key() = minNode->key();
/in/kdtree.hpp:359:25: error: no match for 'operator=' (operand types are 'const Key {aka const std::tuple<int, int, int>}' and 'const Key {aka const std::tuple<int, int, int>}')
             node->key() = maxNode->key();
In file included from /in/kdtree.hpp:1:0,
                 from /in/driver/main.cpp:8:
/usr/include/c++/7/tuple:835:7: note: candidate: std::tuple<_Elements>& std::tuple<_Elements>::operator=(const std::tuple<_Elements>&) [with _Elements = {int, int, int}] <near match>
       operator=(const tuple& __in)
       ^~~~~~~~
/usr/include/c++/7/tuple:835:7: note:   passing 'const Key* {aka const std::tuple<int, int, int>*}' as 'this' argument discards qualifiers
/usr/include/c++/7/tuple:842:7: note: candidate: std::tuple<_Elements>& std::tuple<_Elements>::operator=(std::tuple<_Elements>&&) [with _Elements = {int, int, int}] <near match>
       operator=(tuple&& __in)
       ^~~~~~~~
/usr/include/c++/7/tuple:842:7: note:   conversion of argument 1 would be ill-formed:
In file included from /in/driver/main.cpp:8:0:
/in/kdtree.hpp:359:25: error: cannot bind rvalue reference of type 'std::tuple<int, int, int>&&' to lvalue of type 'const Key {aka const std::tuple<int, int, int>}'
             node->key() = maxNode->key();
In file included from /in/kdtree.hpp:1:0,
                 from /in/driver/main.cpp:8:
/usr/include/c++/7/tuple:853:9: note: candidate: typename std::enable_if<(sizeof... (_UElements) == sizeof... (_Elements)), std::tuple<_Elements>&>::type std::tuple<_Elements>::operator=(const std::tuple<_Args1 ...>&) [with _UElements = {int, int, int}; _Elements = {int, int, int}; typename std::enable_if<(sizeof... (_UElements) == sizeof... (_Elements)), std::tuple<_Elements>&>::type = std::tuple<int, int, int>&] <near match>
         operator=(const tuple<_UElements...>& __in)
         ^~~~~~~~
/usr/include/c++/7/tuple:853:9: note:   passing 'const Key* {aka const std::tuple<int, int, int>*}' as 'this' argument discards qualifiers
/usr/include/c++/7/tuple:863:9: note: candidate: template<class ... _UElements> typename std::enable_if<(sizeof... (_UElements) == sizeof... (_Elements)), std::tuple<_Elements>&>::type std::tuple<_Elements>::operator=(std::tuple<_Args1 ...>&&) [with _UElements = {_UElements ...}; _Elements = {int, int, int}]
         operator=(tuple<_UElements...>&& __in)
         ^~~~~~~~
/usr/include/c++/7/tuple:863:9: note:   template argument deduction/substitution failed:
In file included from /in/driver/main.cpp:8:0:
/in/kdtree.hpp:359:25: note:   types 'std::tuple<_Tps ...>' and 'const Key {aka const std::tuple<int, int, int>}' have incompatible cv-qualifiers
             node->key() = maxNode->key();
/in/kdtree.hpp: In instantiation of 'KDTree<std::tuple<_Elements ...>, ValueType>::Node* KDTree<std::tuple<_Elements ...>, ValueType>::copyFrom(KDTree<std::tuple<_Elements ...>, ValueType>::Node*&, KDTree<std::tuple<_Elements ...>, ValueType>::Node*, KDTree<std::tuple<_Elements ...>, ValueType>::Node*) [with ValueType = std::__cxx11::basic_string<char>; KeyTypes = {int, int, int}]':
/in/kdtree.hpp:471:20:   required from '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:438:12: error: invalid use of non-static member function 'const Key& KDTree<std::tuple<_Elements ...>, ValueType>::Node::key() [with ValueType = std::__cxx11::basic_string<char>; KeyTypes = {int, int, int}; KDTree<std::tuple<_Elements ...>, ValueType>::Key = std::tuple<int, int, int>]'
     node = new Node(copy->key, copy->value, parent);
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/in/kdtree.hpp:40:20: note: declared here
         const Key &key() { return data.first; }
                    ^~~
/in/kdtree.hpp: In instantiation of 'KDTree<std::tuple<_Elements ...>, ValueType>::Node* KDTree<std::tuple<_Elements ...>, ValueType>::findMin(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:304:47:   required from 'KDTree<std::tuple<_Elements ...>, ValueType>::Node* KDTree<std::tuple<_Elements ...>, ValueType>::findMinDynamic(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:523:48:   required from 'KDTree<std::tuple<_Elements ...>, ValueType>::Iterator KDTree<std::tuple<_Elements ...>, ValueType>::findMin(size_t) [with ValueType = std::__cxx11::basic_string<char>; KeyTypes = {int, int, int}; size_t = long unsigned int]'
/in/driver/main.cpp:71:46:   required from here
/in/kdtree.hpp:266:26: error: unused variable 'DIM_NEXT' [-Werror=unused-variable]
         constexpr size_t DIM_NEXT = (DIM + 1) % KeySize;
                          ^~~~~~~~
/in/kdtree.hpp:268:5: error: no return statement in function returning non-void [-Werror=return-type]
     }
     ^
/in/kdtree.hpp:265:25: error: unused parameter 'node' [-Werror=unused-parameter]
     Node *findMin(Node *node) {
                         ^~~~
/in/kdtree.hpp: In instantiation of 'KDTree<std::tuple<_Elements ...>, ValueType>::Node* KDTree<std::tuple<_Elements ...>, ValueType>::findMin(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:347:51:   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:537: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:266:26: error: unused variable 'DIM_NEXT' [-Werror=unused-variable]
         constexpr size_t DIM_NEXT = (DIM + 1) % KeySize;
                          ^~~~~~~~
/in/kdtree.hpp:268:5: error: no return statement in function returning non-void [-Werror=return-type]
     }
     ^
/in/kdtree.hpp:265:25: error: unused parameter 'node' [-Werror=unused-parameter]
     Node *findMin(Node *node) {
                         ^~~~
/in/kdtree.hpp: In instantiation of 'KDTree<std::tuple<_Elements ...>, ValueType>::Node* KDTree<std::tuple<_Elements ...>, ValueType>::findMin(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:304:47:   required from 'KDTree<std::tuple<_Elements ...>, ValueType>::Node* KDTree<std::tuple<_Elements ...>, ValueType>::findMinDynamic(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:305:40:   required from 'KDTree<std::tuple<_Elements ...>, ValueType>::Node* KDTree<std::tuple<_Elements ...>, ValueType>::findMinDynamic(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:523:48:   required from 'KDTree<std::tuple<_Elements ...>, ValueType>::Iterator KDTree<std::tuple<_Elements ...>, ValueType>::findMin(size_t) [with ValueType = std::__cxx11::basic_string<char>; KeyTypes = {int, int, int}; size_t = long unsigned int]'
/in/driver/main.cpp:71:46:   required from here
/in/kdtree.hpp:266:26: error: unused variable 'DIM_NEXT' [-Werror=unused-variable]
         constexpr size_t DIM_NEXT = (DIM + 1) % KeySize;
                          ^~~~~~~~
/in/kdtree.hpp:268:5: error: no return statement in function returning non-void [-Werror=return-type]
     }
     ^
/in/kdtree.hpp:265:25: error: unused parameter 'node' [-Werror=unused-parameter]
     Node *findMin(Node *node) {
                         ^~~~
/in/kdtree.hpp: In instantiation of 'KDTree<std::tuple<_Elements ...>, ValueType>::Node* KDTree<std::tuple<_Elements ...>, ValueType>::findMin(KDTree<std::tuple<_Elements ...>, ValueType>::Node*) [with long unsigned int DIM_CMP = 2; long unsigned int DIM = 0; ValueType = std::__cxx11::basic_string<char>; KeyTypes = {int, int, int}]':
/in/kdtree.hpp:305:40:   recursively required from 'KDTree<std::tuple<_Elements ...>, ValueType>::Node* KDTree<std::tuple<_Elements ...>, ValueType>::findMinDynamic(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:305:40:   required from 'KDTree<std::tuple<_Elements ...>, ValueType>::Node* KDTree<std::tuple<_Elements ...>, ValueType>::findMinDynamic(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:523:48:   required from 'KDTree<std::tuple<_Elements ...>, ValueType>::Iterator KDTree<std::tuple<_Elements ...>, ValueType>::findMin(size_t) [with ValueType = std::__cxx11::basic_string<char>; KeyTypes = {int, int, int}; size_t = long unsigned int]'
/in/driver/main.cpp:71:46:   required from here
/in/kdtree.hpp:266:26: error: unused variable 'DIM_NEXT' [-Werror=unused-variable]
         constexpr size_t DIM_NEXT = (DIM + 1) % KeySize;
                          ^~~~~~~~
/in/kdtree.hpp:268:5: error: no return statement in function returning non-void [-Werror=return-type]
     }
     ^
/in/kdtree.hpp:265:25: error: unused parameter 'node' [-Werror=unused-parameter]
     Node *findMin(Node *node) {
                         ^~~~
/in/kdtree.hpp: In member function 'KDTree<std::tuple<_Elements ...>, ValueType>::Node* KDTree<std::tuple<_Elements ...>, ValueType>::find(const Key&, 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:188:5: error: control reaches end of non-void function [-Werror=return-type]
     }
     ^
/in/kdtree.hpp: In member function '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}]':
/in/kdtree.hpp:219:5: error: control reaches end of non-void function [-Werror=return-type]
     }
     ^
cc1plus: all warnings being treated as errors

Information

Submit By
Type
Submission
Homework
Project 3
Language
C++
Submit At
2024-07-22 14:53:00
Judged At
2024-07-22 14:53:00
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes