For ex,
unordered_set<int> s ;
s.insert(100);
How do I get value 100 from s?
From http://www.cplusplus.com/reference/unordered_set/unordered_set/begin/,
Notice that an
unordered_set
object makes no guarantees on which specific element is considered its first element. But, in any case, the range that goes from its begin to its end covers all the elements in the container (or the bucket), until invalidated.
So s.begin()
won't always give me value 100?
Please clarify.
unordered_set::find
– Hagoodbegin
that you get garbage values? I think the problem lies with code you are not showing. – Hagood