[#BloombergLP-bdlc-FlatHashMap-2constructor-056] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlc.adoc[bdlc]::xref:BloombergLP/bdlc/FlatHashMap.adoc[FlatHashMap]::FlatHashMap :relfileprefix: ../../../ :mrdocs: Constructors == Synopses Declared in `<bdlc_flathashmap.h>` Create an empty `FlatHashMap` object. Optionally specify a `capacity` indicating the minimum initial size of the underlying array of entries of this container. If `capacity` is not supplied or is 0, no memory is allocated. Optionally specify a `hash` functor used to generate the hash values associated with the keys of elements in this container. If `hash` is not supplied, a default‐constructed object of the (template parameter) type `HASH` is used. Optionally specify an equality functor `equal` used to determine whether the keys of two elements are equivalent. If `equal` is not supplied, a default‐constructed object of the (template parameter) type `EQUAL` is used. Optionally specify a `basicAllocator` used to supply memory. If `basicAllocator` is not supplied or is 0, the currently installed default allocator is used. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bdlc/FlatHashMap/2constructor-07.adoc[FlatHashMap](); ---- [.small]#xref:BloombergLP/bdlc/FlatHashMap/2constructor-07.adoc[_» more..._]# Create an empty map with at least the specified `capacity`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- explicit xref:BloombergLP/bdlc/FlatHashMap/2constructor-01.adoc[FlatHashMap](std::size_t capacity); ---- [.small]#xref:BloombergLP/bdlc/FlatHashMap/2constructor-01.adoc[_» more..._]# Create a `FlatHashMap` object having the same value, hasher, equality comparator, and allocator as the specified `original` object. The contents of `original` are moved (in constant time) to this object, `original` is left in a (valid) unspecified state, and no exceptions will be thrown. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bdlc/FlatHashMap/2constructor-0fc.adoc[FlatHashMap](xref:BloombergLP/bslmf/MovableRef.adoc[bslmf::MovableRef<FlatHashMap>] original); ---- [.small]#xref:BloombergLP/bdlc/FlatHashMap/2constructor-0fc.adoc[_» more..._]# Create an empty map using the specified `basicAllocator`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- explicit xref:BloombergLP/bdlc/FlatHashMap/2constructor-0e1.adoc[FlatHashMap](xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator); ---- [.small]#xref:BloombergLP/bdlc/FlatHashMap/2constructor-0e1.adoc[_» more..._]# Create an empty map with at least the specified `capacity`, using the specified `basicAllocator`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bdlc/FlatHashMap/2constructor-0a4.adoc[FlatHashMap]( std::size_t capacity, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator); ---- [.small]#xref:BloombergLP/bdlc/FlatHashMap/2constructor-0a4.adoc[_» more..._]# Create a `FlatHashMap` object having the same value, hasher, and equality comparator as the specified `original` object, using the specified `basicAllocator` to supply memory. If `basicAllocator` is 0, the currently installed default allocator is used. The allocator of `original` remains unchanged. If `original` and the newly created object have the same allocator then the contents of `original` are moved (in constant time) to this object, `original` is left in a (valid) unspecified state, and no exceptions will be thrown; otherwise, `original` is unchanged (and an exception may be thrown). [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bdlc/FlatHashMap/2constructor-03.adoc[FlatHashMap]( xref:BloombergLP/bslmf/MovableRef.adoc[bslmf::MovableRef<FlatHashMap>] original, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator); ---- [.small]#xref:BloombergLP/bdlc/FlatHashMap/2constructor-03.adoc[_» more..._]# Create a `FlatHashMap` object initialized by insertion of the specified `values`. Optionally specify a `capacity` indicating the minimum initial size of the underlying array of entries of this container. If `capacity` is not supplied or is 0, no memory is allocated. Optionally specify a `hash` functor used to generate hash values associated with the keys of elements in this container. If `hash` is not supplied, a default‐constructed object of the (template parameter) type `HASH` is used. Optionally specify an equality functor `equal` used to determine whether the keys of two elements are equivalent. If `equal` is not supplied, a default‐constructed object of the (template parameter) type `EQUAL` is used. Optionally specify a `basicAllocator` used to supply memory. If `basicAllocator` is not supplied or is 0, the currently installed default allocator is used. Note that if a member of `values` has an equivalent key to an earlier member, the later member will not be inserted. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bdlc/FlatHashMap/2constructor-0fa.adoc[FlatHashMap]( bsl::initializer_list<value_type> values, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0); ---- [.small]#xref:BloombergLP/bdlc/FlatHashMap/2constructor-0fa.adoc[_» more..._]# Create a `FlatHashMap` object having the same value, hasher, and equality comparator as the specified `original` object. Optionally specify a `basicAllocator` used to supply memory. If `basicAllocator` is not specified or is 0, the currently installed default allocator is used. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bdlc/FlatHashMap/2constructor-06a.adoc[FlatHashMap]( xref:BloombergLP/bdlc/FlatHashMap.adoc[FlatHashMap] const& original, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0); ---- [.small]#xref:BloombergLP/bdlc/FlatHashMap/2constructor-06a.adoc[_» more..._]# Create an empty map with at least the specified `capacity` and `hash` functor; optionally use `basicAllocator`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bdlc/FlatHashMap/2constructor-051.adoc[FlatHashMap]( std::size_t capacity, HASH const& hash, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0); ---- [.small]#xref:BloombergLP/bdlc/FlatHashMap/2constructor-051.adoc[_» more..._]# Same as the preceding overload, also requesting at least the specified `capacity`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bdlc/FlatHashMap/2constructor-0e8.adoc[FlatHashMap]( bsl::initializer_list<value_type> values, std::size_t capacity, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0); ---- [.small]#xref:BloombergLP/bdlc/FlatHashMap/2constructor-0e8.adoc[_» more..._]# Create a `FlatHashMap` object initialized by insertion of the values from the input iterator range specified by `first` through `last` (including `first`, excluding `last`). Optionally specify a `capacity` indicating the minimum initial size of the underlying array of entries of this container. If `capacity` is not supplied or is 0, no memory is allocated. Optionally specify a `hash` functor used to generate hash values associated with the keys of the elements in this container. If `hash` is not supplied, a default‐constructed object of the (template parameter) type `HASH` is used. Optionally specify an equality functor `equal` used to determine whether the keys of two elements are equivalent. If `equal` is not supplied, a default‐constructed object of the (template parameter) type `EQUAL` is used. Optionally specify a `basicAllocator` used to supply memory. If `basicAllocator` is not supplied or is 0, the currently installed default allocator is used. The behavior is undefined unless `first` and `last` refer to a sequence of valid values where `first` is at a position at or before `last`. Note that if a member of the input sequence has an equivalent key to an earlier member, the later member will not be inserted. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class INPUT_ITERATOR> xref:BloombergLP/bdlc/FlatHashMap/2constructor-06c.adoc[FlatHashMap]( INPUT_ITERATOR first, INPUT_ITERATOR last, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0); ---- [.small]#xref:BloombergLP/bdlc/FlatHashMap/2constructor-06c.adoc[_» more..._]# Create an empty map with at least the specified `capacity`, `hash`, and `equal` predicate; optionally use `basicAllocator`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bdlc/FlatHashMap/2constructor-0c.adoc[FlatHashMap]( std::size_t capacity, HASH const& hash, EQUAL const& equal, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0); ---- [.small]#xref:BloombergLP/bdlc/FlatHashMap/2constructor-0c.adoc[_» more..._]# Same as the preceding overload, also using the specified `hash`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bdlc/FlatHashMap/2constructor-00.adoc[FlatHashMap]( bsl::initializer_list<value_type> values, std::size_t capacity, HASH const& hash, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0); ---- [.small]#xref:BloombergLP/bdlc/FlatHashMap/2constructor-00.adoc[_» more..._]# Same as the preceding overload, also requesting at least the specified `capacity`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class INPUT_ITERATOR> xref:BloombergLP/bdlc/FlatHashMap/2constructor-0d4.adoc[FlatHashMap]( INPUT_ITERATOR first, INPUT_ITERATOR last, std::size_t capacity, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0); ---- [.small]#xref:BloombergLP/bdlc/FlatHashMap/2constructor-0d4.adoc[_» more..._]# Same as the preceding overload, also using the specified `equal`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bdlc/FlatHashMap/2constructor-0af.adoc[FlatHashMap]( bsl::initializer_list<value_type> values, std::size_t capacity, HASH const& hash, EQUAL const& equal, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0); ---- [.small]#xref:BloombergLP/bdlc/FlatHashMap/2constructor-0af.adoc[_» more..._]# Same as the preceding overload, also using the specified `hash`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class INPUT_ITERATOR> xref:BloombergLP/bdlc/FlatHashMap/2constructor-0d7.adoc[FlatHashMap]( INPUT_ITERATOR first, INPUT_ITERATOR last, std::size_t capacity, HASH const& hash, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0); ---- [.small]#xref:BloombergLP/bdlc/FlatHashMap/2constructor-0d7.adoc[_» more..._]# Same as the preceding overload, also using the specified `equal`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class INPUT_ITERATOR> xref:BloombergLP/bdlc/FlatHashMap/2constructor-08.adoc[FlatHashMap]( INPUT_ITERATOR first, INPUT_ITERATOR last, std::size_t capacity, HASH const& hash, EQUAL const& equal, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0); ---- [.small]#xref:BloombergLP/bdlc/FlatHashMap/2constructor-08.adoc[_» more..._]# [.small]#Created with https://www.mrdocs.com[MrDocs]#