Each hash container has a constructor which takes the following arguments, with the following defaults:
size_type num_buckets = 0 const key_hasher& hash = key_hasher() const key_compare& comp = key_compare() float load_factor_limit = 2 float growth_factor = 4 const allocator_type& a = allocator_type()
Since all arguments have defaults, the constructor serves as a default constructor. It is also declared explicit to inhibit implicit conversions from the first argument: size_type. The first argument is a way to specify the initial number of buckets. This was chosen as the first parameter in order to remain compatible both with previous versions of EWL hash containers, as well as the SGI hash containers.
The second and third parameters allow client code to initialize the hash and compare function objects if necessary. This will typically only be necessary if ordinary function pointers are being used. When function objects are used, the default constructed function object is often sufficient.
The fourth and fifth parameters allow you to set the initial values of load_factor_limit and growth_factor. Details on how these parameters interact with the size() and bucket_count() of the container can be found in the capacity section.
A second constructor also exists that accepts templated input iterators for constructing a hash container from a range. After the pair of iterators, the six parameters from the first constructor follow in the same order, and with the same defaults.