<hash_set> equality operator doesn't work in VS2010
Posted
by ProgramWriter
on Stack Overflow
See other posts from Stack Overflow
or by ProgramWriter
Published on 2010-05-05T11:31:15Z
Indexed on
2010/05/05
11:38 UTC
Read the original article
Hit count: 102
Sample code:
std::hash_set<int> hs1; // also i try std::unorded_set<int> - same effect
std::hash_set<int> hs2;
hs1.insert(15);
hs1.insert(20);
hs2.insert(20);
hs2.insert(15);
assert(hs1 == hs2);
hash_set doesn't stores elements in some order defined by hash function... why? Please note that this code works in VS2008 using stdext::hash_set.
© Stack Overflow or respective owner