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:125:27: error: could not convert '((Map<std::__cxx11::basic_string<char>, int>*)this)->Map<std::__cxx11::basic_string<char>, int>::tree.BinarySearchTree<std::pair<std::__cxx11::basic_string<char>, int>, Map<std::__cxx11::basic_string<char>, int>::PairComp>::insert((* & val))' from 'BinarySearchTree<std::pair<std::__cxx11::basic_string<char>, int>, Map<std::__cxx11::basic_string<char>, int>::PairComp>::Iterator' to 'std::pair<BinarySearchTree<std::pair<std::__cxx11::basic_string<char>, int>, Map<std::__cxx11::basic_string<char>, int>::PairComp>::Iterator, bool>'
     return tree.insert(val);
                           ^
/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:125:27: error: could not convert '((Map<Duck, std::__cxx11::basic_string<char>, DuckWealthLess>*)this)->Map<Duck, std::__cxx11::basic_string<char>, DuckWealthLess>::tree.BinarySearchTree<std::pair<Duck, std::__cxx11::basic_string<char> >, Map<Duck, std::__cxx11::basic_string<char>, DuckWealthLess>::PairComp>::insert((* & val))' from 'BinarySearchTree<std::pair<Duck, std::__cxx11::basic_string<char> >, Map<Duck, std::__cxx11::basic_string<char>, DuckWealthLess>::PairComp>::Iterator' to 'std::pair<BinarySearchTree<std::pair<Duck, std::__cxx11::basic_string<char> >, Map<Duck, std::__cxx11::basic_string<char>, DuckWealthLess>::PairComp>::Iterator, 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:109:18: error: 'struct std::pair<std::__cxx11::basic_string<char>, int>' has no member named 'Value_type'; did you mean 'first_type'?
       return it->Value_type;
              ~~~~^~~~~~~~~~
              first_type
/in/Map.h:112:21: error: 'class BinarySearchTree<std::pair<std::__cxx11::basic_string<char>, int>, Map<std::__cxx11::basic_string<char>, int>::PairComp>::Iterator' has no member named 'first'
       return result.first->Value_type;
              ~~~~~~~^~~~~
/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:109:18: error: 'struct std::pair<Duck, std::__cxx11::basic_string<char> >' has no member named 'Value_type'; did you mean 'first_type'?
       return it->Value_type;
              ~~~~^~~~~~~~~~
              first_type
/in/Map.h:112:21: error: 'class BinarySearchTree<std::pair<Duck, std::__cxx11::basic_string<char> >, Map<Duck, std::__cxx11::basic_string<char>, DuckWealthLess>::PairComp>::Iterator' has no member named 'first'
       return result.first->Value_type;
              ~~~~~~~^~~~~
/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 17:48:50
Judged At
2024-07-05 17:48:50
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes