Record Detail

Compile Error

/in/Compile/Map_compile_check.cpp: In function 'int main()':
/in/Compile/Map_compile_check.cpp:36:20: error: no matching function for call to 'Map<std::__cxx11::basic_string<char>, int>::Map()'
   Map<string, int> map;
                    ^~~
In file included from /in/Compile/Map_compile_check.cpp:5:0:
/in/Map.h:68:3: note: candidate: Map<Key_type, Value_type, Key_compare>::Map(const Map<Key_type, Value_type, Key_compare>&) [with Key_type = std::__cxx11::basic_string<char>; Value_type = int; Key_compare = std::less<std::__cxx11::basic_string<char> >]
   Map(const Map &other) : entries(other.entries) {}
   ^~~
/in/Map.h:68:3: note:   candidate expects 1 argument, 0 provided
/in/Compile/Map_compile_check.cpp:39:37: error: no matching function for call to 'Map<Duck, std::__cxx11::basic_string<char>, DuckWealthLess>::Map()'
   Map<Duck, string, DuckWealthLess> duck_map;
                                     ^~~~~~~~
In file included from /in/Compile/Map_compile_check.cpp:5:0:
/in/Map.h:68:3: note: candidate: Map<Key_type, Value_type, Key_compare>::Map(const Map<Key_type, Value_type, Key_compare>&) [with Key_type = Duck; Value_type = std::__cxx11::basic_string<char>; Key_compare = DuckWealthLess]
   Map(const Map &other) : entries(other.entries) {}
   ^~~
/in/Map.h:68:3: note:   candidate expects 1 argument, 0 provided
/in/Map.h: In instantiation of '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/Map.h:96:40: 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>&, int) const'
     return entries.find(k, Value_type());
                                        ^
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:   candidate expects 1 argument, 2 provided
In file included from /in/Compile/Map_compile_check.cpp:5:0:
/in/Map.h: In instantiation of '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/Map.h:96:40: 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&, std::__cxx11::basic_string<char>) const'
     return entries.find(k, Value_type());
                                        ^
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:   candidate expects 1 argument, 2 provided
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 = 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:118:18: error: no matching function for call to 'Map<std::__cxx11::basic_string<char>, int>::insert(const std::__cxx11::basic_string<char>&, int)'
       it = insert(k, Value_type()).first;
            ~~~~~~^~~~~~~~~~~~~~~~~
/in/Map.h:131:29: note: candidate: 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>]
   std::pair<Iterator, bool> insert(const Pair_type &val) {
                             ^~~~~~
/in/Map.h:131:29: note:   candidate expects 1 argument, 2 provided
/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:118:18: error: no matching function for call to 'Map<Duck, std::__cxx11::basic_string<char>, DuckWealthLess>::insert(const Duck&, std::__cxx11::basic_string<char>)'
       it = insert(k, Value_type()).first;
            ~~~~~~^~~~~~~~~~~~~~~~~
/in/Map.h:131:29: note: candidate: 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> >]
   std::pair<Iterator, bool> insert(const Pair_type &val) {
                             ^~~~~~
/in/Map.h:131:29: note:   candidate expects 1 argument, 2 provided
/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-04 11:43:47
Judged At
2024-07-04 11:43:47
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes