Record Detail

Compile Error

In file included from /in/driver/main.cpp:8:0:
/in/kdtree.hpp:233:57: error: 'Compare' has not been declared
     static bool compareKey1(const Key &a, const Key &b, Compare compare = Compare()) {
                                                         ^~~~~~~
/in/kdtree.hpp:233:75: error: there are no arguments to 'Compare' that depend on a template parameter, so a declaration of 'Compare' must be available [-fpermissive]
     static bool compareKey1(const Key &a, const Key &b, Compare compare = Compare()) {
                                                                           ^~~~~~~
/in/kdtree.hpp:233:75: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
/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:174:43: error: expected primary-expression before '>' token
         else if(compareKey1<DIM,std::less<>>(key,node->key())){
                                           ^~
/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:205:43: error: expected primary-expression before '>' token
         else if(compareKey1<DIM,std::less<>>(key,node->key())){
                                           ^~
/in/kdtree.hpp: In static member function 'static bool KDTree<std::tuple<_Elements ...>, ValueType>::compareKey1(const Key&, const Key&, int)':
/in/kdtree.hpp:234:37: error: 'DIM' was not declared in this scope
             return compare(std::get<DIM>(a), std::get<DIM>(b));
                                     ^~~
/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:348:42: error: expected primary-expression before '>' token
             if(compareKey1<DIM,std::less<>>(key,node->key())){
                                          ^~
/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:469: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:205:28: error: ordered comparison of pointer with integer zero [-Werror=extra]
         else if(compareKey1<DIM,std::less<>>(key,node->key())){
                 ~~~~~~~~~~~^~~~
/in/kdtree.hpp:205:49: error: left operand of comma operator has no effect [-Werror=unused-value]
         else if(compareKey1<DIM,std::less<>>(key,node->key())){
                                             ~~~~^~~~~~~~~~~~~
/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:492: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:348:27: error: ordered comparison of pointer with integer zero [-Werror=extra]
             if(compareKey1<DIM,std::less<>>(key,node->key())){
                ~~~~~~~~~~~^~~~
/in/kdtree.hpp:348:48: error: left operand of comma operator has no effect [-Werror=unused-value]
             if(compareKey1<DIM,std::less<>>(key,node->key())){
                                            ~~~~^~~~~~~~~~~~~
/in/kdtree.hpp: In instantiation of '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}; KDTree<std::tuple<_Elements ...>, ValueType>::Key = std::tuple<int, int, int>]':
/in/kdtree.hpp:465:38:   required from 'KDTree<std::tuple<_Elements ...>, ValueType>::Iterator KDTree<std::tuple<_Elements ...>, ValueType>::find(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:118:38:   required from here
/in/kdtree.hpp:174:28: error: ordered comparison of pointer with integer zero [-Werror=extra]
         else if(compareKey1<DIM,std::less<>>(key,node->key())){
                 ~~~~~~~~~~~^~~~
/in/kdtree.hpp:174:49: error: left operand of comma operator has no effect [-Werror=unused-value]
         else if(compareKey1<DIM,std::less<>>(key,node->key())){
                                             ~~~~^~~~~~~~~~~~~
/in/kdtree.hpp: In instantiation of 'static bool KDTree<std::tuple<_Elements ...>, ValueType>::compareKey1(const Key&, const Key&, int) [with ValueType = std::__cxx11::basic_string<char>; KeyTypes = {int, int, int}; KDTree<std::tuple<_Elements ...>, ValueType>::Key = std::tuple<int, int, int>]':
/in/kdtree.hpp:205:28:   required from '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:469: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:234:27: error: 'compare' cannot be used as a function
             return compare(std::get<DIM>(a), std::get<DIM>(b));
                    ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/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 = 1; 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:206:29:   required from '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:469: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:205:28: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
         else if(compareKey1<DIM,std::less<>>(key,node->key())){
                 ~~~~~~~~~~~^~~~
/in/kdtree.hpp:205:49: error: left operand of comma operator has no effect [-Werror=unused-value]
         else if(compareKey1<DIM,std::less<>>(key,node->key())){
                                             ~~~~^~~~~~~~~~~~~
/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:338: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:492: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:348:27: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
             if(compareKey1<DIM,std::less<>>(key,node->key())){
                ~~~~~~~~~~~^~~~
/in/kdtree.hpp:348:48: error: left operand of comma operator has no effect [-Werror=unused-value]
             if(compareKey1<DIM,std::less<>>(key,node->key())){
                                            ~~~~^~~~~~~~~~~~~
/in/kdtree.hpp: In instantiation of '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 = 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:175:34:   required from '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}; KDTree<std::tuple<_Elements ...>, ValueType>::Key = std::tuple<int, int, int>]'
/in/kdtree.hpp:465:38:   required from 'KDTree<std::tuple<_Elements ...>, ValueType>::Iterator KDTree<std::tuple<_Elements ...>, ValueType>::find(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:118:38:   required from here
/in/kdtree.hpp:174:28: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
         else if(compareKey1<DIM,std::less<>>(key,node->key())){
                 ~~~~~~~~~~~^~~~
/in/kdtree.hpp:174:49: error: left operand of comma operator has no effect [-Werror=unused-value]
         else if(compareKey1<DIM,std::less<>>(key,node->key())){
                                             ~~~~^~~~~~~~~~~~~
/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:338: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::tuple<int, int, int>]'
/in/kdtree.hpp:338: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:492: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:348:27: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
             if(compareKey1<DIM,std::less<>>(key,node->key())){
                ~~~~~~~~~~~^~~~
/in/kdtree.hpp:348:48: error: left operand of comma operator has no effect [-Werror=unused-value]
             if(compareKey1<DIM,std::less<>>(key,node->key())){
                                            ~~~~^~~~~~~~~~~~~
/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:181: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-21 10:00:11
Judged At
2024-07-21 10:00:11
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes