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:161:10: error: no matching function for call to 'BinarySearchTree<std::pair<std::__cxx11::basic_string<char>, int>, Map<std::__cxx11::basic_string<char>, int>::PairComp>::find(const std::__cxx11::basic_string<char>&)'
     auto it = bst_.find(val.first);
          ^~
In file included from /in/Map.h:19:0,
                 from /in/Compile/Map_compile_check.cpp:5:
/in/BinarySearchTree.h:276:12: note: candidate: 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]
   Iterator find(const T &query) const {
            ^~~~
/in/BinarySearchTree.h:276:12: note:   no known conversion for argument 1 from 'const std::__cxx11::basic_string<char>' to 'const std::pair<std::__cxx11::basic_string<char>, int>&'
In file included from /in/Compile/Map_compile_check.cpp:5:0:
/in/Map.h:164:24: error: could not convert '{it, false}' from '<brace-enclosed initializer list>' to 'std::pair<BinarySearchTree<std::pair<std::__cxx11::basic_string<char>, int>, Map<std::__cxx11::basic_string<char>, int>::PairComp>::Iterator, bool>'
       return {it, false};
                        ^
/in/Map.h:168:41: error: no matching function for call to 'BinarySearchTree<std::pair<std::__cxx11::basic_string<char>, int>, Map<std::__cxx11::basic_string<char>, int>::PairComp>::find(const std::__cxx11::basic_string<char>&)'
       return {bst_.find(val.first), true};
                                         ^
In file included from /in/Map.h:19:0,
                 from /in/Compile/Map_compile_check.cpp:5:
/in/BinarySearchTree.h:276:12: note: candidate: 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]
   Iterator find(const T &query) const {
            ^~~~
/in/BinarySearchTree.h:276:12: note:   no known conversion for argument 1 from 'const std::__cxx11::basic_string<char>' to 'const std::pair<std::__cxx11::basic_string<char>, int>&'
In file included from /in/Compile/Map_compile_check.cpp:5:0:
/in/Map.h:168:41: error: could not convert '{<expression error>, true}' from '<brace-enclosed initializer list>' to 'std::pair<BinarySearchTree<std::pair<std::__cxx11::basic_string<char>, int>, Map<std::__cxx11::basic_string<char>, int>::PairComp>::Iterator, bool>'
       return {bst_.find(val.first), true};
                                         ^
/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:161:10: error: no matching function for call to 'BinarySearchTree<std::pair<Duck, std::__cxx11::basic_string<char> >, Map<Duck, std::__cxx11::basic_string<char>, DuckWealthLess>::PairComp>::find(const Duck&)'
     auto it = bst_.find(val.first);
          ^~
In file included from /in/Map.h:19:0,
                 from /in/Compile/Map_compile_check.cpp:5:
/in/BinarySearchTree.h:276:12: note: candidate: 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]
   Iterator find(const T &query) const {
            ^~~~
/in/BinarySearchTree.h:276:12: note:   no known conversion for argument 1 from 'const Duck' to 'const std::pair<Duck, std::__cxx11::basic_string<char> >&'
In file included from /in/Compile/Map_compile_check.cpp:5:0:
/in/Map.h:164:24: error: could not convert '{it, false}' from '<brace-enclosed initializer list>' to 'std::pair<BinarySearchTree<std::pair<Duck, std::__cxx11::basic_string<char> >, Map<Duck, std::__cxx11::basic_string<char>, DuckWealthLess>::PairComp>::Iterator, bool>'
       return {it, false};
                        ^
/in/Map.h:168:41: error: no matching function for call to 'BinarySearchTree<std::pair<Duck, std::__cxx11::basic_string<char> >, Map<Duck, std::__cxx11::basic_string<char>, DuckWealthLess>::PairComp>::find(const Duck&)'
       return {bst_.find(val.first), true};
                                         ^
In file included from /in/Map.h:19:0,
                 from /in/Compile/Map_compile_check.cpp:5:
/in/BinarySearchTree.h:276:12: note: candidate: 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]
   Iterator find(const T &query) const {
            ^~~~
/in/BinarySearchTree.h:276:12: note:   no known conversion for argument 1 from 'const Duck' to 'const std::pair<Duck, std::__cxx11::basic_string<char> >&'
In file included from /in/Compile/Map_compile_check.cpp:5:0:
/in/Map.h:168:41: error: could not convert '{<expression error>, true}' from '<brace-enclosed initializer list>' to 'std::pair<BinarySearchTree<std::pair<Duck, std::__cxx11::basic_string<char> >, Map<Duck, std::__cxx11::basic_string<char>, DuckWealthLess>::PairComp>::Iterator, bool>'
       return {bst_.find(val.first), true};
                                         ^
/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 22:27:21
Judged At
2024-07-05 22:27:21
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes