Record Detail

Compile Error

In file included from /in/driver/main.cpp:8:0:
/in/kdtree.hpp: In instantiation of 'static bool KDTree<std::tuple<_Elements ...>, ValueType>::cmp_of_unique(const Data&, const Data&) [with 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:455:39:   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:419:23: error: no match for 'operator=' (operand types are 'const std::tuple<int, int, int>' and 'const std::tuple<int, int, int>')
         return a.first=b.first;
                ~~~~~~~^~~~~~~~
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 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:419:26: error: cannot bind rvalue reference of type 'std::tuple<int, int, int>&&' to lvalue of type 'const std::tuple<int, int, int>'
         return a.first=b.first;
                        ~~^~~~~
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 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:419:23: note:   types 'std::tuple<_Tps ...>' and 'const std::tuple<int, int, int>' have incompatible cv-qualifiers
         return a.first=b.first;
                ~~~~~~~^~~~~~~~

Information

Submit By
Type
Submission
Homework
Project 3: K-D tree
Language
C++
Submit At
2023-11-23 21:53:07
Judged At
2023-11-23 21:53:07
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes