Record Detail

Compile Error

In file included from /in/Compile/Map_compile_check.cpp:5:0:
/in/Map.h: In member function 'bool Map<Key_type, Value_type, Key_compare>::PairComp::operator()(const Pair_type&, const Pair_type&) const':
/in/Map.h:38:14: error: there are no arguments to 'Compare' that depend on a template parameter, so a declaration of 'Compare' must be available [-fpermissive]
       return Compare()(a.first, b.first);
              ^~~~~~~
/in/Map.h:38:14: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
/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: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:141: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:145: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:145: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:138: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:141: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:145: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:145: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/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:116: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(k);
          ^~
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:124:14: 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(k)->second;
              ^~~~
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: 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:116: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(k);
          ^~
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:124:14: 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(k)->second;
              ^~~~
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: In instantiation of 'bool Map<Key_type, Value_type, Key_compare>::PairComp::operator()(const Pair_type&, const 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>]':
/in/BinarySearchTree.h:560:20:   required from '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/Map.h:38:21: error: 'Compare' was not declared in this scope
       return Compare()(a.first, b.first);
              ~~~~~~~^~
/in/Map.h: In instantiation of 'bool Map<Key_type, Value_type, Key_compare>::PairComp::operator()(const Pair_type&, const 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> >]':
/in/BinarySearchTree.h:560:20:   required from '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/Map.h:38:21: error: 'Compare' was not declared in this scope
/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 21:58:35
Judged At
2024-07-05 21:58:35
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes