Constructors
Declared in <bslstl_hashtable.h>
Create a hash-table having the same value (and maxLoadFactor) as the specified original object by moving (in constant time) the contents of original to the new hash-table. Use a copy of original.hasher() and a copy of original.comparator() to organize elements in this hash-table. The allocator associated with original is propagated for use in the newly created hash-table. original is left in a valid but unspecified state.
HashTable(BloombergLP::bslmf::MovableRef<HashTable<UnorderedMapKeyConfiguration<basic_string<char> const, pair<basic_string<char> const, Json>>, TransparentHash, TransparentEqualTo, allocator<pair<basic_string<char> const, Json>>>> original);
» more...
Create a hash-table having the same value (and maxLoadFactor) as the specified original object. Use a copy of original.hasher() and a copy of original.comparator() to organize elements in this hash-table. Use the allocator returned by 'bsl::allocator_traits<ALLOCATOR>:: select_on_container_copy_construction(original.allocator())' to allocate memory. This method requires that the ValueType defined by the (template parameter) type KEY_CONFIG be copy-insertable into this hash-table (see '{Requirements on KEY_CONFIG}). Note that this hash-table may have fewer buckets than original, and a correspondingly higher loadFactor, so long as maxLoadFactor is not exceeded. Also note that the created hash table may have a different numBuckets than original, and a correspondingly different loadFactor, as long as maxLoadFactor is not exceeded.
HashTable(HashTable<UnorderedMapKeyConfiguration<basic_string<char> const, pair<basic_string<char> const, Json>>, TransparentHash, TransparentEqualTo, allocator<pair<basic_string<char> const, Json>>> const& original);
» more...
Create an empty hash-table. Optionally specify a basicAllocator used to supply memory. If basicAllocator is not supplied, a default-constructed object of the (template parameter) type ALLOCATOR is used. If the type ALLOCATOR is bsl::allocator and basicAllocator is not supplied, the currently installed default allocator is used to supply memory. Use 1.0 for the maxLoadFactor. Use a default constructed object of the (template parameter) type HASHER and a default constructed object of the (template parameter) type COMPARATOR to organize elements in the table. No memory is allocated unless the HASHER or COMPARATOR types allocate memory in their default constructor. Note that a bslma::Allocator * can be supplied for basicAllocator if the type ALLOCATOR is bsl::allocator (the default).
explicit
HashTable(allocator<pair<basic_string<char> const, Json>> const& basicAllocator = ALLOCATOR());
» more...
Create a hash table having the same value (and maxLoadFactor) as the specified original object that uses the specified basicAllocator to supply memory. The contents of original are moved (in constant time) to the new hash-table if basicAllocator == original.get_allocator(), and are move-inserted (in linear time) using basicAllocator otherwise. original is left in a valid but unspecified state. Use a copy of original.hasher() and a copy of original.comparator() to organize elements in this hash-table. This method requires that the ValueType defined by the (template parameter) type KEY_CONFIG be move-insertable into this hash-table. Note that this hash-table may have a different numBuckets than original, and a correspondingly different loadFactor, as long as maxLoadFactor is not exceeded. Also note that a bslma::Allocator * can be supplied for basicAllocator if the (template parameter) ALLOCATOR is bsl::allocator (the default).
HashTable(
BloombergLP::bslmf::MovableRef<HashTable<UnorderedMapKeyConfiguration<basic_string<char> const, pair<basic_string<char> const, Json>>, TransparentHash, TransparentEqualTo, allocator<pair<basic_string<char> const, Json>>>> original,
allocator<pair<basic_string<char> const, Json>> const& basicAllocator);
» more...
Create a hash-table having the same value (and maxLoadFactor) as the specified original object that uses the specified basicAllocator to supply memory. Use a copy of original.hasher() and a copy of original.comparator() to organize elements in this hash-table. This method requires that the ValueType defined by the (template parameter) type KEY_CONFIG be move-insertable into this hash-table. Note that this hash-table may have a different numBuckets than original, and a correspondingly different loadFactor, as long as maxLoadFactor is not exceeded.
HashTable(
HashTable<UnorderedMapKeyConfiguration<basic_string<char> const, pair<basic_string<char> const, Json>>, TransparentHash, TransparentEqualTo, allocator<pair<basic_string<char> const, Json>>> const& original,
allocator<pair<basic_string<char> const, Json>> const& basicAllocator);
» more...
Create an empty hash-table using the specified hash and compare functors to organize elements in the table, which will initially have at least the specified initialNumBuckets and a maxLoadFactor of the specified initialMaxLoadFactor. Optionally specify a basicAllocator used to supply memory. If basicAllocator is not supplied, a default-constructed object of the (template parameter) type ALLOCATOR is used. If the type ALLOCATOR is bsl::allocator and basicAllocator is not supplied, the currently installed default allocator is used to supply memory. If this constructor tries to allocate a number of buckets larger than can be represented by this hash-table's SizeType, a std::length_error exception is thrown. The behavior is undefined unless 0 < initialMaxLoadFactor. Note that more than initialNumBuckets buckets may be created in order to preserve the bucket allocation strategy of the hash-table (but never fewer). Also note that a bslma::Allocator * can be supplied for basicAllocator if the type ALLOCATOR is bsl::allocator (the default).
HashTable(
TransparentHash const& hash,
TransparentEqualTo const& compare,
SizeType initialNumBuckets,
float initialMaxLoadFactor,
allocator<pair<basic_string<char> const, Json>> const& basicAllocator = ALLOCATOR());
» more...