unordered-set Questions

1

Solved

I found this in the standard as the post-condition for the rehash function in unordered associative containers : Post: a.bucket_count() > a.size() / a.max_load_factor() and a.bucket_count() >= n...
Mongo asked 26/3, 2012 at 23:13

2

Solved

I'm writing a class that has an unordered_set of its own type as a member. Therefore I need to write a specialization for hash<Foo>. This specialization needs to be defined after Foo is decla...
Barrack asked 8/1, 2012 at 22:22

2

Solved

I just found myself a little bit surprised being unable to simply use a std::unordered_set<std::array<int, 16> > test; because there does not seem to be a std::hash specialization fo...
Brawn asked 6/11, 2011 at 13:41

3

Solved

To support user-defined key types in std::unordered_set<Key> and std::unordered_map<Key, Value> one has to provide operator==(Key, Key) and a hash functor: struct X { int id; /* ... */...
Iridescent asked 16/11, 2011 at 20:5

3

Solved

Suppose I have the following User struct: struct User { string userId; UserType userType; // UserType is just an enumeration string hostName; string ipAddress; //and more other attributes ...
Enfleurage asked 5/10, 2011 at 13:54

5

Solved

What is operator size_t () const Environment: Visual Studio 2010 Professional TL; DR Today I was searching for a way to use std::tr1::unordered_set. Because I asked for how to use std::map l...
Hamner asked 5/7, 2011 at 15:21

1

This question is related to this one, and more precisely to this answer to it. Here goes: I have a C++/TR1 unordered_set U of unsigned ints (rough cardinality 100-50000, rough value range 0 to 10^...
Diaconal asked 15/12, 2010 at 21:28

© 2022 - 2024 — McMap. All rights reserved.