Record Detail

Compile Error

In file included from /in/Compile/BinarySearchTree_compile_check.cpp:4:0:
/in/BinarySearchTree.h: In instantiation of 'static bool BinarySearchTree<T, Compare>::check_sorting_invariant_impl(const BinarySearchTree<T, Compare>::Node*, Compare) [with T = int; Compare = std::less<int>]':
/in/BinarySearchTree.h:148:44:   required from 'bool BinarySearchTree<T, Compare>::check_sorting_invariant() const [with T = int; Compare = std::less<int>]'
/in/Compile/BinarySearchTree_compile_check.cpp:89:42:   required from here
/in/BinarySearchTree.h:493:26: error: no match for call to '(std::less<int>) (BinarySearchTree<int>::Node*, const int&)'
                 l = (less(max_element_impl(node->left), node->datum) &&
                      ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/7/string:48:0,
                 from /usr/include/c++/7/bits/locale_classes.h:40,
                 from /usr/include/c++/7/bits/ios_base.h:41,
                 from /usr/include/c++/7/ios:42,
                 from /usr/include/c++/7/ostream:38,
                 from /usr/include/c++/7/iostream:39,
                 from /in/Compile/BinarySearchTree_compile_check.cpp:3:
/usr/include/c++/7/bits/stl_function.h:385:7: note: candidate: constexpr bool std::less<_Tp>::operator()(const _Tp&, const _Tp&) const [with _Tp = int] <near match>
       operator()(const _Tp& __x, const _Tp& __y) const
       ^~~~~~~~
/usr/include/c++/7/bits/stl_function.h:385:7: note:   conversion of argument 1 would be ill-formed:
In file included from /in/Compile/BinarySearchTree_compile_check.cpp:4:0:
/in/BinarySearchTree.h:493:43: error: invalid conversion from 'BinarySearchTree<int>::Node*' to 'int' [-fpermissive]
                 l = (less(max_element_impl(node->left), node->datum) &&
                           ~~~~~~~~~~~~~~~~^~~~~~~~~~~~
/in/BinarySearchTree.h:498:26: error: no match for call to '(std::less<int>) (const int&, BinarySearchTree<int>::Node*)'
                 r = (less(node->datum, min_element_impl(node->right)) &&
                      ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/7/string:48:0,
                 from /usr/include/c++/7/bits/locale_classes.h:40,
                 from /usr/include/c++/7/bits/ios_base.h:41,
                 from /usr/include/c++/7/ios:42,
                 from /usr/include/c++/7/ostream:38,
                 from /usr/include/c++/7/iostream:39,
                 from /in/Compile/BinarySearchTree_compile_check.cpp:3:
/usr/include/c++/7/bits/stl_function.h:385:7: note: candidate: constexpr bool std::less<_Tp>::operator()(const _Tp&, const _Tp&) const [with _Tp = int] <near match>
       operator()(const _Tp& __x, const _Tp& __y) const
       ^~~~~~~~
/usr/include/c++/7/bits/stl_function.h:385:7: note:   conversion of argument 2 would be ill-formed:
In file included from /in/Compile/BinarySearchTree_compile_check.cpp:4:0:
/in/BinarySearchTree.h:498:56: error: invalid conversion from 'BinarySearchTree<int>::Node*' to 'int' [-fpermissive]
                 r = (less(node->datum, min_element_impl(node->right)) &&
                                        ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
/in/BinarySearchTree.h: In instantiation of 'static bool BinarySearchTree<T, Compare>::check_sorting_invariant_impl(const BinarySearchTree<T, Compare>::Node*, Compare) [with T = Duck; Compare = DuckWealthLess]':
/in/BinarySearchTree.h:148:44:   required from 'bool BinarySearchTree<T, Compare>::check_sorting_invariant() const [with T = Duck; Compare = DuckWealthLess]'
/in/Compile/BinarySearchTree_compile_check.cpp:90:47:   required from here
/in/BinarySearchTree.h:493:26: error: no match for call to '(DuckWealthLess) (BinarySearchTree<Duck, DuckWealthLess>::Node*, const Duck&)'
                 l = (less(max_element_impl(node->left), node->datum) &&
                      ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/in/Compile/BinarySearchTree_compile_check.cpp:21:8: note: candidate: bool DuckWealthLess::operator()(const Duck&, const Duck&) const <near match>
   bool operator() (const Duck &d1, const Duck &d2) const {
        ^~~~~~~~
/in/Compile/BinarySearchTree_compile_check.cpp:21:8: note:   conversion of argument 1 would be ill-formed:
In file included from /in/Compile/BinarySearchTree_compile_check.cpp:4:0:
/in/BinarySearchTree.h:493:43: error: invalid user-defined conversion from 'BinarySearchTree<Duck, DuckWealthLess>::Node*' to 'const Duck&' [-fpermissive]
                 l = (less(max_element_impl(node->left), node->datum) &&
                           ~~~~~~~~~~~~~~~~^~~~~~~~~~~~
/in/Compile/BinarySearchTree_compile_check.cpp:11:3: note: candidate is: Duck::Duck(int) <near match>
   Duck(int wealth_in) : wealth(wealth_in) {}
   ^~~~
/in/Compile/BinarySearchTree_compile_check.cpp:11:3: note:   conversion of argument 1 would be ill-formed:
In file included from /in/Compile/BinarySearchTree_compile_check.cpp:4:0:
/in/BinarySearchTree.h:493:43: error: invalid conversion from 'BinarySearchTree<Duck, DuckWealthLess>::Node*' to 'int' [-fpermissive]
                 l = (less(max_element_impl(node->left), node->datum) &&
                           ~~~~~~~~~~~~~~~~^~~~~~~~~~~~
/in/BinarySearchTree.h:493:43: error: invalid conversion from 'BinarySearchTree<Duck, DuckWealthLess>::Node*' to 'int' [-fpermissive]
/in/Compile/BinarySearchTree_compile_check.cpp:11:3: note:   initializing argument 1 of 'Duck::Duck(int)'
   Duck(int wealth_in) : wealth(wealth_in) {}
   ^~~~
In file included from /in/Compile/BinarySearchTree_compile_check.cpp:4:0:
/in/BinarySearchTree.h:498:26: error: no match for call to '(DuckWealthLess) (const Duck&, BinarySearchTree<Duck, DuckWealthLess>::Node*)'
                 r = (less(node->datum, min_element_impl(node->right)) &&
                      ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/in/Compile/BinarySearchTree_compile_check.cpp:21:8: note: candidate: bool DuckWealthLess::operator()(const Duck&, const Duck&) const <near match>
   bool operator() (const Duck &d1, const Duck &d2) const {
        ^~~~~~~~
/in/Compile/BinarySearchTree_compile_check.cpp:21:8: note:   conversion of argument 2 would be ill-formed:
In file included from /in/Compile/BinarySearchTree_compile_check.cpp:4:0:
/in/BinarySearchTree.h:498:56: error: invalid user-defined conversion from 'BinarySearchTree<Duck, DuckWealthLess>::Node*' to 'const Duck&' [-fpermissive]
                 r = (less(node->datum, min_element_impl(node->right)) &&
                                        ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
/in/Compile/BinarySearchTree_compile_check.cpp:11:3: note: candidate is: Duck::Duck(int) <near match>
   Duck(int wealth_in) : wealth(wealth_in) {}
   ^~~~
/in/Compile/BinarySearchTree_compile_check.cpp:11:3: note:   conversion of argument 1 would be ill-formed:
In file included from /in/Compile/BinarySearchTree_compile_check.cpp:4:0:
/in/BinarySearchTree.h:498:56: error: invalid conversion from 'BinarySearchTree<Duck, DuckWealthLess>::Node*' to 'int' [-fpermissive]
                 r = (less(node->datum, min_element_impl(node->right)) &&
                                        ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
/in/BinarySearchTree.h:498:56: error: invalid conversion from 'BinarySearchTree<Duck, DuckWealthLess>::Node*' to 'int' [-fpermissive]
/in/Compile/BinarySearchTree_compile_check.cpp:11:3: note:   initializing argument 1 of 'Duck::Duck(int)'
   Duck(int wealth_in) : wealth(wealth_in) {}
   ^~~~
In file included from /in/Compile/BinarySearchTree_compile_check.cpp:4:0:
/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 = int; Compare = std::less<int>]':
/in/BinarySearchTree.h:262:52:   required from 'BinarySearchTree<T, Compare>::Iterator BinarySearchTree<T, Compare>::min_greater_than(const T&) const [with T = int; Compare = std::less<int>]'
/in/Compile/BinarySearchTree_compile_check.cpp:110:37:   required from here
/in/BinarySearchTree.h:555:22: error: no match for call to '(std::less<int>) (const int&, BinarySearchTree<int>::Node*)'
             if (!less(val, max_element_impl(node))) {
                  ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/7/string:48:0,
                 from /usr/include/c++/7/bits/locale_classes.h:40,
                 from /usr/include/c++/7/bits/ios_base.h:41,
                 from /usr/include/c++/7/ios:42,
                 from /usr/include/c++/7/ostream:38,
                 from /usr/include/c++/7/iostream:39,
                 from /in/Compile/BinarySearchTree_compile_check.cpp:3:
/usr/include/c++/7/bits/stl_function.h:385:7: note: candidate: constexpr bool std::less<_Tp>::operator()(const _Tp&, const _Tp&) const [with _Tp = int] <near match>
       operator()(const _Tp& __x, const _Tp& __y) const
       ^~~~~~~~
/usr/include/c++/7/bits/stl_function.h:385:7: note:   conversion of argument 2 would be ill-formed:
In file included from /in/Compile/BinarySearchTree_compile_check.cpp:4:0:
/in/BinarySearchTree.h:555:44: error: invalid conversion from 'BinarySearchTree<int>::Node*' to 'int' [-fpermissive]
             if (!less(val, max_element_impl(node))) {
                            ~~~~~~~~~~~~~~~~^~~~~~
/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 = Duck; Compare = DuckWealthLess]':
/in/BinarySearchTree.h:262:52:   required from 'BinarySearchTree<T, Compare>::Iterator BinarySearchTree<T, Compare>::min_greater_than(const T&) const [with T = Duck; Compare = DuckWealthLess]'
/in/Compile/BinarySearchTree_compile_check.cpp:111:52:   required from here
/in/BinarySearchTree.h:555:22: error: no match for call to '(DuckWealthLess) (const Duck&, BinarySearchTree<Duck, DuckWealthLess>::Node*)'
             if (!less(val, max_element_impl(node))) {
                  ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/in/Compile/BinarySearchTree_compile_check.cpp:21:8: note: candidate: bool DuckWealthLess::operator()(const Duck&, const Duck&) const <near match>
   bool operator() (const Duck &d1, const Duck &d2) const {
        ^~~~~~~~
/in/Compile/BinarySearchTree_compile_check.cpp:21:8: note:   conversion of argument 2 would be ill-formed:
In file included from /in/Compile/BinarySearchTree_compile_check.cpp:4:0:
/in/BinarySearchTree.h:555:44: error: invalid user-defined conversion from 'BinarySearchTree<Duck, DuckWealthLess>::Node*' to 'const Duck&' [-fpermissive]
             if (!less(val, max_element_impl(node))) {
                            ~~~~~~~~~~~~~~~~^~~~~~
/in/Compile/BinarySearchTree_compile_check.cpp:11:3: note: candidate is: Duck::Duck(int) <near match>
   Duck(int wealth_in) : wealth(wealth_in) {}
   ^~~~
/in/Compile/BinarySearchTree_compile_check.cpp:11:3: note:   conversion of argument 1 would be ill-formed:
In file included from /in/Compile/BinarySearchTree_compile_check.cpp:4:0:
/in/BinarySearchTree.h:555:44: error: invalid conversion from 'BinarySearchTree<Duck, DuckWealthLess>::Node*' to 'int' [-fpermissive]
             if (!less(val, max_element_impl(node))) {
                            ~~~~~~~~~~~~~~~~^~~~~~
/in/BinarySearchTree.h:555:44: error: invalid conversion from 'BinarySearchTree<Duck, DuckWealthLess>::Node*' to 'int' [-fpermissive]
/in/Compile/BinarySearchTree_compile_check.cpp:11:3: note:   initializing argument 1 of 'Duck::Duck(int)'
   Duck(int wealth_in) : wealth(wealth_in) {}
   ^~~~
/in/Compile/Makefile:30: recipe for target 'BinarySearchTree_compile_check.exe' failed
make: *** [BinarySearchTree_compile_check.exe] Error 1

Information

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