Record Detail

Compile Error

In file included from /in/Compile/Map_compile_check.cpp:5:0:
/in/Map.h: In instantiation of 'std::pair<typename BinarySearchTree<std::pair<_T1, _T2>, Map<Key_type, Value_type, Key_compare>::PairComp>::Iterator, bool> Map<Key_type, Value_type, Key_compare>::insert(const Pair_type&) [with Key_type = std::__cxx11::basic_string<char>; Value_type = int; Key_compare = std::less<std::__cxx11::basic_string<char> >; typename BinarySearchTree<std::pair<_T1, _T2>, Map<Key_type, Value_type, Key_compare>::PairComp>::Iterator = BinarySearchTree<std::pair<std::__cxx11::basic_string<char>, int>, Map<std::__cxx11::basic_string<char>, int>::PairComp>::Iterator; Map<Key_type, Value_type, Key_compare>::Pair_type = std::pair<std::__cxx11::basic_string<char>, int>]':
/in/Compile/Map_compile_check.cpp:80:26:   required from here
/in/Map.h:138:9: error: no match for 'operator!' (operand type is 'BinarySearchTree<std::pair<std::__cxx11::basic_string<char>, int>, Map<std::__cxx11::basic_string<char>, int>::PairComp>::Iterator')
     if (!it) {
         ^~~
/in/Map.h:138:9: note: candidate: operator!(bool) <built-in>
/in/Map.h:138:9: note:   no known conversion for argument 1 from 'BinarySearchTree<std::pair<std::__cxx11::basic_string<char>, int>, Map<std::__cxx11::basic_string<char>, int>::PairComp>::Iterator' to 'bool'
/in/Map.h: In instantiation of 'std::pair<typename BinarySearchTree<std::pair<_T1, _T2>, Map<Key_type, Value_type, Key_compare>::PairComp>::Iterator, bool> Map<Key_type, Value_type, Key_compare>::insert(const Pair_type&) [with Key_type = Duck; Value_type = std::__cxx11::basic_string<char>; Key_compare = DuckWealthLess; typename BinarySearchTree<std::pair<_T1, _T2>, Map<Key_type, Value_type, Key_compare>::PairComp>::Iterator = BinarySearchTree<std::pair<Duck, std::__cxx11::basic_string<char> >, Map<Duck, std::__cxx11::basic_string<char>, DuckWealthLess>::PairComp>::Iterator; Map<Key_type, Value_type, Key_compare>::Pair_type = std::pair<Duck, std::__cxx11::basic_string<char> >]':
/in/Compile/Map_compile_check.cpp:82:47:   required from here
/in/Map.h:138:9: error: no match for 'operator!' (operand type is 'BinarySearchTree<std::pair<Duck, std::__cxx11::basic_string<char> >, Map<Duck, std::__cxx11::basic_string<char>, DuckWealthLess>::PairComp>::Iterator')
/in/Map.h:138:9: note: candidate: operator!(bool) <built-in>
/in/Map.h:138:9: note:   no known conversion for argument 1 from 'BinarySearchTree<std::pair<Duck, std::__cxx11::basic_string<char> >, Map<Duck, std::__cxx11::basic_string<char>, DuckWealthLess>::PairComp>::Iterator' to 'bool'
/in/Map.h: In instantiation of 'Value_type& Map<Key_type, Value_type, Key_compare>::operator[](const Key_type&) [with Key_type = std::__cxx11::basic_string<char>; Value_type = int; Key_compare = std::less<std::__cxx11::basic_string<char> >]':
/in/Compile/Map_compile_check.cpp:85:21:   required from here
/in/Map.h:120:5: error: could not convert 'it' from 'BinarySearchTree<std::pair<std::__cxx11::basic_string<char>, int>, Map<std::__cxx11::basic_string<char>, int>::PairComp>::Iterator' to 'bool'
     if (it) {
     ^~
/in/Map.h:121:18: error: 'struct std::pair<std::__cxx11::basic_string<char>, int>' has no member named 'datum'
       return it->datum.second;
              ~~~~^~~~~
/in/Map.h:125:21: error: 'struct std::pair<std::__cxx11::basic_string<char>, int>' has no member named 'datum'
     return find(k)->datum.second;
            ~~~~~~~~~^~~~~
/in/Map.h: In instantiation of 'Value_type& Map<Key_type, Value_type, Key_compare>::operator[](const Key_type&) [with Key_type = Duck; Value_type = std::__cxx11::basic_string<char>; Key_compare = DuckWealthLess]':
/in/Compile/Map_compile_check.cpp:87:35:   required from here
/in/Map.h:120:5: error: could not convert 'it' from 'BinarySearchTree<std::pair<Duck, std::__cxx11::basic_string<char> >, Map<Duck, std::__cxx11::basic_string<char>, DuckWealthLess>::PairComp>::Iterator' to 'bool'
     if (it) {
     ^~
/in/Map.h:121:18: error: 'struct std::pair<Duck, std::__cxx11::basic_string<char> >' has no member named 'datum'
       return it->datum.second;
              ~~~~^~~~~
/in/Map.h:125:21: error: 'struct std::pair<Duck, std::__cxx11::basic_string<char> >' has no member named 'datum'
     return find(k)->datum.second;
            ~~~~~~~~~^~~~~
In file included from /in/Map.h:19:0,
                 from /in/Compile/Map_compile_check.cpp:5:
/in/BinarySearchTree.h: In instantiation of 'static BinarySearchTree<T, Compare>::Node* BinarySearchTree<T, Compare>::min_greater_than_impl(BinarySearchTree<T, Compare>::Node*, const T&, Compare) [with T = std::pair<std::__cxx11::basic_string<char>, int>; Compare = Map<std::__cxx11::basic_string<char>, int>::PairComp]':
/in/BinarySearchTree.h:198:45:   required from 'BinarySearchTree<T, Compare>::Iterator& BinarySearchTree<T, Compare>::Iterator::operator++() [with T = std::pair<std::__cxx11::basic_string<char>, int>; Compare = Map<std::__cxx11::basic_string<char>, int>::PairComp]'
/in/Compile/Map_compile_check.cpp:98:7:   required from here
/in/BinarySearchTree.h:526:13: error: no match for call to '(Map<std::__cxx11::basic_string<char>, int>::PairComp) (const std::pair<std::__cxx11::basic_string<char>, int>&, std::pair<std::__cxx11::basic_string<char>, int>&)'
     if (less(val, node->datum)) {
         ~~~~^~~~~~~~~~~~~~~~~~
In file included from /in/Compile/Map_compile_check.cpp:5:0:
/in/Map.h:37:10: note: candidate: bool Map<Key_type, Value_type, Key_compare>::PairComp::operator()(Map<Key_type, Value_type, Key_compare>::Pair_type&, Map<Key_type, Value_type, Key_compare>::Pair_type&) const [with Key_type = std::__cxx11::basic_string<char>; Value_type = int; Key_compare = std::less<std::__cxx11::basic_string<char> >; Map<Key_type, Value_type, Key_compare>::Pair_type = std::pair<std::__cxx11::basic_string<char>, int>] <near match>
     bool operator()(Pair_type& a, Pair_type& b) const {
          ^~~~~~~~
/in/Map.h:37:10: note:   conversion of argument 1 would be ill-formed:
In file included from /in/Map.h:19:0,
                 from /in/Compile/Map_compile_check.cpp:5:
/in/BinarySearchTree.h:526:13: error: binding reference of type 'Map<std::__cxx11::basic_string<char>, int>::Pair_type& {aka std::pair<std::__cxx11::basic_string<char>, int>&}' to 'const std::pair<std::__cxx11::basic_string<char>, int>' discards qualifiers
     if (less(val, node->datum)) {
         ~~~~^~~~~~~~~~~~~~~~~~
/in/BinarySearchTree.h: In instantiation of 'static BinarySearchTree<T, Compare>::Node* BinarySearchTree<T, Compare>::min_greater_than_impl(BinarySearchTree<T, Compare>::Node*, const T&, Compare) [with T = std::pair<Duck, std::__cxx11::basic_string<char> >; Compare = Map<Duck, std::__cxx11::basic_string<char>, DuckWealthLess>::PairComp]':
/in/BinarySearchTree.h:198:45:   required from 'BinarySearchTree<T, Compare>::Iterator& BinarySearchTree<T, Compare>::Iterator::operator++() [with T = std::pair<Duck, std::__cxx11::basic_string<char> >; Compare = Map<Duck, std::__cxx11::basic_string<char>, DuckWealthLess>::PairComp]'
/in/Compile/Map_compile_check.cpp:99:7:   required from here
/in/BinarySearchTree.h:526:13: error: no match for call to '(Map<Duck, std::__cxx11::basic_string<char>, DuckWealthLess>::PairComp) (const std::pair<Duck, std::__cxx11::basic_string<char> >&, std::pair<Duck, std::__cxx11::basic_string<char> >&)'
In file included from /in/Compile/Map_compile_check.cpp:5:0:
/in/Map.h:37:10: note: candidate: bool Map<Key_type, Value_type, Key_compare>::PairComp::operator()(Map<Key_type, Value_type, Key_compare>::Pair_type&, Map<Key_type, Value_type, Key_compare>::Pair_type&) const [with Key_type = Duck; Value_type = std::__cxx11::basic_string<char>; Key_compare = DuckWealthLess; Map<Key_type, Value_type, Key_compare>::Pair_type = std::pair<Duck, std::__cxx11::basic_string<char> >] <near match>
     bool operator()(Pair_type& a, Pair_type& b) const {
          ^~~~~~~~
/in/Map.h:37:10: note:   conversion of argument 1 would be ill-formed:
In file included from /in/Map.h:19:0,
                 from /in/Compile/Map_compile_check.cpp:5:
/in/BinarySearchTree.h:526:13: error: binding reference of type 'Map<Duck, std::__cxx11::basic_string<char>, DuckWealthLess>::Pair_type& {aka std::pair<Duck, std::__cxx11::basic_string<char> >&}' to 'const std::pair<Duck, std::__cxx11::basic_string<char> >' discards qualifiers
     if (less(val, node->datum)) {
         ~~~~^~~~~~~~~~~~~~~~~~
/in/BinarySearchTree.h: In instantiation of 'static BinarySearchTree<T, Compare>::Node* BinarySearchTree<T, Compare>::find_impl(BinarySearchTree<T, Compare>::Node*, const T&, Compare) [with T = std::pair<std::__cxx11::basic_string<char>, int>; Compare = Map<std::__cxx11::basic_string<char>, int>::PairComp]':
/in/BinarySearchTree.h:277:36:   required from 'BinarySearchTree<T, Compare>::Iterator BinarySearchTree<T, Compare>::find(const T&) const [with T = std::pair<std::__cxx11::basic_string<char>, int>; Compare = Map<std::__cxx11::basic_string<char>, int>::PairComp]'
/in/Map.h:99:26:   required from 'Map<Key_type, Value_type, Key_compare>::Iterator Map<Key_type, Value_type, Key_compare>::find(const Key_type&) const [with Key_type = std::__cxx11::basic_string<char>; Value_type = int; Key_compare = std::less<std::__cxx11::basic_string<char> >; Map<Key_type, Value_type, Key_compare>::Iterator = BinarySearchTree<std::pair<std::__cxx11::basic_string<char>, int>, Map<std::__cxx11::basic_string<char>, int>::PairComp>::Iterator]'
/in/Compile/Map_compile_check.cpp:74:25:   required from here
/in/BinarySearchTree.h:397:13: error: no match for call to '(Map<std::__cxx11::basic_string<char>, int>::PairComp) (const std::pair<std::__cxx11::basic_string<char>, int>&, std::pair<std::__cxx11::basic_string<char>, int>&)'
     if (less(query, node->datum)) {
         ~~~~^~~~~~~~~~~~~~~~~~~~
In file included from /in/Compile/Map_compile_check.cpp:5:0:
/in/Map.h:37:10: note: candidate: bool Map<Key_type, Value_type, Key_compare>::PairComp::operator()(Map<Key_type, Value_type, Key_compare>::Pair_type&, Map<Key_type, Value_type, Key_compare>::Pair_type&) const [with Key_type = std::__cxx11::basic_string<char>; Value_type = int; Key_compare = std::less<std::__cxx11::basic_string<char> >; Map<Key_type, Value_type, Key_compare>::Pair_type = std::pair<std::__cxx11::basic_string<char>, int>] <near match>
     bool operator()(Pair_type& a, Pair_type& b) const {
          ^~~~~~~~
/in/Map.h:37:10: note:   conversion of argument 1 would be ill-formed:
In file included from /in/Map.h:19:0,
                 from /in/Compile/Map_compile_check.cpp:5:
/in/BinarySearchTree.h:397:13: error: binding reference of type 'Map<std::__cxx11::basic_string<char>, int>::Pair_type& {aka std::pair<std::__cxx11::basic_string<char>, int>&}' to 'const std::pair<std::__cxx11::basic_string<char>, int>' discards qualifiers
     if (less(query, node->datum)) {
         ~~~~^~~~~~~~~~~~~~~~~~~~
/in/BinarySearchTree.h:399:20: error: no match for call to '(Map<std::__cxx11::basic_string<char>, int>::PairComp) (std::pair<std::__cxx11::basic_string<char>, int>&, const std::pair<std::__cxx11::basic_string<char>, int>&)'
     } else if (less(node->datum, query)) {
                ~~~~^~~~~~~~~~~~~~~~~~~~
In file included from /in/Compile/Map_compile_check.cpp:5:0:
/in/Map.h:37:10: note: candidate: bool Map<Key_type, Value_type, Key_compare>::PairComp::operator()(Map<Key_type, Value_type, Key_compare>::Pair_type&, Map<Key_type, Value_type, Key_compare>::Pair_type&) const [with Key_type = std::__cxx11::basic_string<char>; Value_type = int; Key_compare = std::less<std::__cxx11::basic_string<char> >; Map<Key_type, Value_type, Key_compare>::Pair_type = std::pair<std::__cxx11::basic_string<char>, int>] <near match>
     bool operator()(Pair_type& a, Pair_type& b) const {
          ^~~~~~~~
/in/Map.h:37:10: note:   conversion of argument 2 would be ill-formed:
In file included from /in/Map.h:19:0,
                 from /in/Compile/Map_compile_check.cpp:5:
/in/BinarySearchTree.h:399:20: error: binding reference of type 'Map<std::__cxx11::basic_string<char>, int>::Pair_type& {aka std::pair<std::__cxx11::basic_string<char>, int>&}' to 'const std::pair<std::__cxx11::basic_string<char>, int>' discards qualifiers
     } else if (less(node->datum, query)) {
                ~~~~^~~~~~~~~~~~~~~~~~~~
/in/BinarySearchTree.h: In instantiation of 'static BinarySearchTree<T, Compare>::Node* BinarySearchTree<T, Compare>::find_impl(BinarySearchTree<T, Compare>::Node*, const T&, Compare) [with T = std::pair<Duck, std::__cxx11::basic_string<char> >; Compare = Map<Duck, std::__cxx11::basic_string<char>, DuckWealthLess>::PairComp]':
/in/BinarySearchTree.h:277:36:   required from 'BinarySearchTree<T, Compare>::Iterator BinarySearchTree<T, Compare>::find(const T&) const [with T = std::pair<Duck, std::__cxx11::basic_string<char> >; Compare = Map<Duck, std::__cxx11::basic_string<char>, DuckWealthLess>::PairComp]'
/in/Map.h:99:26:   required from 'Map<Key_type, Value_type, Key_compare>::Iterator Map<Key_type, Value_type, Key_compare>::find(const Key_type&) const [with Key_type = Duck; Value_type = std::__cxx11::basic_string<char>; Key_compare = DuckWealthLess; Map<Key_type, Value_type, Key_compare>::Iterator = BinarySearchTree<std::pair<Duck, std::__cxx11::basic_string<char> >, Map<Duck, std::__cxx11::basic_string<char>, DuckWealthLess>::PairComp>::Iterator]'
/in/Compile/Map_compile_check.cpp:75:39:   required from here
/in/BinarySearchTree.h:397:13: error: no match for call to '(Map<Duck, std::__cxx11::basic_string<char>, DuckWealthLess>::PairComp) (const std::pair<Duck, std::__cxx11::basic_string<char> >&, std::pair<Duck, std::__cxx11::basic_string<char> >&)'
     if (less(query, node->datum)) {
         ~~~~^~~~~~~~~~~~~~~~~~~~
In file included from /in/Compile/Map_compile_check.cpp:5:0:
/in/Map.h:37:10: note: candidate: bool Map<Key_type, Value_type, Key_compare>::PairComp::operator()(Map<Key_type, Value_type, Key_compare>::Pair_type&, Map<Key_type, Value_type, Key_compare>::Pair_type&) const [with Key_type = Duck; Value_type = std::__cxx11::basic_string<char>; Key_compare = DuckWealthLess; Map<Key_type, Value_type, Key_compare>::Pair_type = std::pair<Duck, std::__cxx11::basic_string<char> >] <near match>
     bool operator()(Pair_type& a, Pair_type& b) const {
          ^~~~~~~~
/in/Map.h:37:10: note:   conversion of argument 1 would be ill-formed:
In file included from /in/Map.h:19:0,
                 from /in/Compile/Map_compile_check.cpp:5:
/in/BinarySearchTree.h:397:13: error: binding reference of type 'Map<Duck, std::__cxx11::basic_string<char>, DuckWealthLess>::Pair_type& {aka std::pair<Duck, std::__cxx11::basic_string<char> >&}' to 'const std::pair<Duck, std::__cxx11::basic_string<char> >' discards qualifiers
     if (less(query, node->datum)) {
         ~~~~^~~~~~~~~~~~~~~~~~~~
/in/BinarySearchTree.h:399:20: error: no match for call to '(Map<Duck, std::__cxx11::basic_string<char>, DuckWealthLess>::PairComp) (std::pair<Duck, std::__cxx11::basic_string<char> >&, const std::pair<Duck, std::__cxx11::basic_string<char> >&)'
     } else if (less(node->datum, query)) {
                ~~~~^~~~~~~~~~~~~~~~~~~~
In file included from /in/Compile/Map_compile_check.cpp:5:0:
/in/Map.h:37:10: note: candidate: bool Map<Key_type, Value_type, Key_compare>::PairComp::operator()(Map<Key_type, Value_type, Key_compare>::Pair_type&, Map<Key_type, Value_type, Key_compare>::Pair_type&) const [with Key_type = Duck; Value_type = std::__cxx11::basic_string<char>; Key_compare = DuckWealthLess; Map<Key_type, Value_type, Key_compare>::Pair_type = std::pair<Duck, std::__cxx11::basic_string<char> >] <near match>
     bool operator()(Pair_type& a, Pair_type& b) const {
          ^~~~~~~~
/in/Map.h:37:10: note:   conversion of argument 2 would be ill-formed:
In file included from /in/Map.h:19:0,
                 from /in/Compile/Map_compile_check.cpp:5:
/in/BinarySearchTree.h:399:20: error: binding reference of type 'Map<Duck, std::__cxx11::basic_string<char>, DuckWealthLess>::Pair_type& {aka std::pair<Duck, std::__cxx11::basic_string<char> >&}' to 'const std::pair<Duck, std::__cxx11::basic_string<char> >' discards qualifiers
     } else if (less(node->datum, query)) {
                ~~~~^~~~~~~~~~~~~~~~~~~~
/in/Compile/Makefile:32: recipe for target 'Map_compile_check.exe' failed
make: *** [Map_compile_check.exe] Error 1

Information

Submit By
Type
Submission
Homework
Project 5
Language
C++
Submit At
2024-07-05 14:48:45
Judged At
2024-07-05 14:48:45
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes