This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/56267] New: [4.7/4.8 Regression] unordered containers require Assignable hash function
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 09 Feb 2013 18:49:49 +0000
- Subject: [Bug libstdc++/56267] New: [4.7/4.8 Regression] unordered containers require Assignable hash function
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56267
Bug #: 56267
Summary: [4.7/4.8 Regression] unordered containers require
Assignable hash function
Classification: Unclassified
Product: gcc
Version: 4.7.3
Status: UNCONFIRMED
Keywords: rejects-valid
Severity: normal
Priority: P3
Component: libstdc++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: redi@gcc.gnu.org
#include <unordered_set>
struct hash : std::hash<int>
{
hash& operator=(const hash&) = delete;
};
int main()
{
std::unordered_set<int, hash> s{ 0, 1, 2 };
auto i = s.begin(0);
i = i;
}
The standard does not require hash functions to be assignable.
We must cache the hash code unless is_copy_assignable<H> is true, I'm testing
the fix.