Record Detail

Compile Error

In file included from /in/Compile/check.cpp:5:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/unordered_map:47:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/hashtable.h:35:
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/hashtable_policy.h:87:11: error: type 'const std::hash<State>' does not provide a call operator
        noexcept(declval<const _Hash&>()(declval<const _Key&>()))>
                 ^~~~~~~~~~~~~~~~~~~~~~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/type_traits:144:14: note: in instantiation of template class 'std::__detail::__is_noexcept_hash<State, std::hash<State> >' requested here
    : public conditional<_B1::value, _B2, _B1>::type
             ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/type_traits:154:36: note: in instantiation of template class 'std::__and_<std::__is_fast_hash<std::hash<State> >, std::__detail::__is_noexcept_hash<State, std::hash<State> > >' requested here
    : public __bool_constant<!bool(_Pp::value)>
                                   ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/unordered_set.h:45:34: note: in instantiation of template class 'std::__not_<std::__and_<std::__is_fast_hash<std::hash<State> >, std::__detail::__is_noexcept_hash<State, std::hash<State> > > >' requested here
           typename _Tr = __uset_traits<__cache_default<_Value, _Hash>::value>>
                                        ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/unordered_set.h:98:15: note: in instantiation of default argument for '__uset_hashtable<State, std::hash<State>, std::equal_to<State>, std::allocator<State> >' required here
      typedef __uset_hashtable<_Value, _Hash, _Pred, _Alloc>  _Hashtable;
              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/in/sokoban.hpp:134:31: note: in instantiation of template class 'std::unordered_set<State, std::hash<State>, std::equal_to<State>, std::allocator<State> >' requested here
    std::unordered_set<State> visited;
                              ^
In file included from /in/Compile/check.cpp:7:
In file included from /in/sokoban.hpp:5:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/unordered_set:48:
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/unordered_set.h:497:7: error: functions that differ only in their return type cannot be overloaded
      insert(node_type&& __nh)
      ^
/in/sokoban.hpp:134:31: note: in instantiation of template class 'std::unordered_set<State, std::hash<State>, std::equal_to<State>, std::allocator<State> >' requested here
    std::unordered_set<State> visited;
                              ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/unordered_set.h:423:7: note: previous declaration is here
      insert(value_type&& __x)
      ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/unordered_set.h:502:7: error: multiple overloads of 'insert' instantiate to the same signature 'std::unordered_set<State, std::hash<State>, std::equal_to<State>, std::allocator<State> >::iterator (std::unordered_set<State, std::hash<State>, std::equal_to<State>, std::allocator<State> >::const_iterator, std::unordered_set<State, std::hash<State>, std::equal_to<State>, std::allocator<State> >::node_type &&)' (aka 'int (int, int &&)')
      insert(const_iterator, node_type&& __nh)
      ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/unordered_set.h:452:7: note: previous declaration is here
      insert(const_iterator __hint, value_type&& __x)
      ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/unordered_set.h:526:7: error: multiple overloads of 'erase' instantiate to the same signature 'std::unordered_set<State, std::hash<State>, std::equal_to<State>, std::allocator<State> >::iterator (std::unordered_set<State, std::hash<State>, std::equal_to<State>, std::allocator<State> >::iterator)' (aka 'int (int)')
      erase(iterator __position)
      ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/unordered_set.h:521:7: note: previous declaration is here
      erase(const_iterator __position)
      ^
In file included from /in/Compile/check.cpp:1:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/iostream:39:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/ostream:38:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/ios:42:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/ios_base.h:41:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/locale_classes.h:40:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/string:48:
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/stl_function.h:386:20: error: invalid operands to binary expression ('const State' and 'const State')
      { return __x < __y; }
               ~~~ ^ ~~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/predefined_ops.h:177:16: note: in instantiation of member function 'std::less<State>::operator()' requested here
        { return bool(_M_comp(*__it, __val)); }
                      ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/stl_heap.h:133:42: note: in instantiation of function template specialization '__gnu_cxx::__ops::_Iter_comp_val<std::less<State> >::operator()<__gnu_cxx::__normal_iterator<State *, std::vector<State, std::allocator<State> > >, State>' requested here
      while (__holeIndex > __topIndex && __comp(__first + __parent, __value))
                                         ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/stl_heap.h:207:12: note: in instantiation of function template specialization 'std::__push_heap<__gnu_cxx::__normal_iterator<State *, std::vector<State, std::allocator<State> > >, long, State, __gnu_cxx::__ops::_Iter_comp_val<std::less<State> > >' requested here
      std::__push_heap(__first, _DistanceType((__last - __first) - 1),
           ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/stl_queue.h:598:7: note: in instantiation of function template specialization 'std::push_heap<__gnu_cxx::__normal_iterator<State *, std::vector<State, std::allocator<State> > >, std::less<State> >' requested here
        std::push_heap(c.begin(), c.end(), comp);
             ^
/in/sokoban.hpp:132:8: note: in instantiation of member function 'std::priority_queue<State, std::vector<State, std::allocator<State> >, std::less<State> >::push' requested here
    pq.push(initial_state); // Push the initial state to the queue
       ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/stl_pair.h:454:5: note: candidate template ignored: could not match 'pair<type-parameter-0-0, type-parameter-0-1>' against 'const State'
    operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/stl_iterator.h:308:5: note: candidate template ignored: could not match 'reverse_iterator<type-parameter-0-0>' against 'const State'
    operator<(const reverse_iterator<_Iterator>& __x,
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/stl_iterator.h:346:5: note: candidate template ignored: could not match 'reverse_iterator<type-parameter-0-0>' against 'const State'
    operator<(const reverse_iterator<_IteratorL>& __x,
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/stl_iterator.h:1145:5: note: candidate template ignored: could not match 'move_iterator<type-parameter-0-0>' against 'const State'
    operator<(const move_iterator<_IteratorL>& __x,
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/stl_iterator.h:1151:5: note: candidate template ignored: could not match 'move_iterator<type-parameter-0-0>' against 'const State'
    operator<(const move_iterator<_Iterator>& __x,
    ^
5 errors generated.
/in/Compile/Makefile:16: recipe for target 'main' failed
make: *** [main] Error 1

Information

Submit By
Type
Submission
Homework
Project3
Language
C++
Submit At
2024-11-27 20:39:06
Judged At
2024-11-27 20:39:06
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes