$ cat test.cpp #include <unordered_set> struct value {}; struct hash { std::size_t operator()(value const&)const; }; bool operator==(value const&,value const&); std::unordered_set<value,hash> set; bool z=(set==set); $ g++ -std=c++0x -c test.cpp 2>&1 | egrep error ...../include/c++/4.7.0/bits/hashtable_policy.h:1116:4: error: no match for ‘operator!=’ in ‘__ity.std::__detail::_Node_const_iterator<_Value, __constant_iterators, __cache>::operator*<value, true, true>() != __itx.std::__detail::_Node_const_iterator<_Value, __constant_iterators, __cache>::operator*<value, true, true>()’ "set==set" needs operator!=(value,value). The "value" type is EqualityComparable and looks good for unordered_set. (17.6.3.1, 23.2.1, 23.2.5/2 and 23.2.5/11) All other associative unordered containers do not need value_type::operator!=(). Only unordered_set requires it.
Oops, but seems trivial to fix.
Author: paolo Date: Mon Feb 20 11:11:39 2012 New Revision: 184388 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=184388 Log: 2012-02-20 Paolo Carlini <paolo.carlini@oracle.com> PR libstdc++/52309 * include/bits/hashtable_policy.h (_Equality_base<, true,>:: _M_equal(const _Hashtable&)): Compare values with operator==. * testsuite/23_containers/unordered_set/operators/52309.cc: New. Added: trunk/libstdc++-v3/testsuite/23_containers/unordered_set/operators/52309.cc Modified: trunk/libstdc++-v3/ChangeLog trunk/libstdc++-v3/include/bits/hashtable_policy.h
Author: paolo Date: Mon Feb 20 11:31:01 2012 New Revision: 184389 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=184389 Log: 2012-02-20 Paolo Carlini <paolo.carlini@oracle.com> PR libstdc++/52309 * include/bits/hashtable_policy.h (_Equality_base<, true,>:: _M_equal(const _Hashtable&)): Compare values with operator==. * testsuite/23_containers/unordered_set/operators/52309.cc: New. Added: branches/gcc-4_6-branch/libstdc++-v3/testsuite/23_containers/unordered_set/operators/52309.cc Modified: branches/gcc-4_6-branch/libstdc++-v3/ChangeLog branches/gcc-4_6-branch/libstdc++-v3/include/bits/hashtable_policy.h
Fixed mainline and 4.6.3.