[#BloombergLP-bdlc-FlatHashSet-2constructor-0a] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlc.adoc[bdlc]::xref:BloombergLP/bdlc/FlatHashSet.adoc[FlatHashSet]::FlatHashSet :relfileprefix: ../../../ :mrdocs: Constructors == Synopses Declared in `<bdlc_flathashset.h>` Create an empty `FlatHashSet` 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 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 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/FlatHashSet/2constructor-077.adoc[FlatHashSet](); ---- [.small]#xref:BloombergLP/bdlc/FlatHashSet/2constructor-077.adoc[_» more..._]# Create an empty set with at least the specified `capacity`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- explicit xref:BloombergLP/bdlc/FlatHashSet/2constructor-0f1.adoc[FlatHashSet](std::size_t capacity); ---- [.small]#xref:BloombergLP/bdlc/FlatHashSet/2constructor-0f1.adoc[_» more..._]# Create a `FlatHashSet` 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/FlatHashSet/2constructor-075.adoc[FlatHashSet](xref:BloombergLP/bslmf/MovableRef.adoc[bslmf::MovableRef<FlatHashSet>] original); ---- [.small]#xref:BloombergLP/bdlc/FlatHashSet/2constructor-075.adoc[_» more..._]# Create an empty set using the specified `basicAllocator`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- explicit xref:BloombergLP/bdlc/FlatHashSet/2constructor-05a0.adoc[FlatHashSet](xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator); ---- [.small]#xref:BloombergLP/bdlc/FlatHashSet/2constructor-05a0.adoc[_» more..._]# Create an empty set with at least the specified `capacity`, using the specified `basicAllocator`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bdlc/FlatHashSet/2constructor-00.adoc[FlatHashSet]( std::size_t capacity, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator); ---- [.small]#xref:BloombergLP/bdlc/FlatHashSet/2constructor-00.adoc[_» more..._]# Create a `FlatHashSet` 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/FlatHashSet/2constructor-0fc.adoc[FlatHashSet]( xref:BloombergLP/bslmf/MovableRef.adoc[bslmf::MovableRef<FlatHashSet>] original, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator); ---- [.small]#xref:BloombergLP/bdlc/FlatHashSet/2constructor-0fc.adoc[_» more..._]# Create a `FlatHashSet` 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 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 verify that 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 a key equivalent to an earlier member, the later member will not be inserted. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bdlc/FlatHashSet/2constructor-05aa.adoc[FlatHashSet]( bsl::initializer_list<KEY> values, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0); ---- [.small]#xref:BloombergLP/bdlc/FlatHashSet/2constructor-05aa.adoc[_» more..._]# Create a `FlatHashSet` 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/FlatHashSet/2constructor-01.adoc[FlatHashSet]( xref:BloombergLP/bdlc/FlatHashSet.adoc[FlatHashSet] const& original, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0); ---- [.small]#xref:BloombergLP/bdlc/FlatHashSet/2constructor-01.adoc[_» more..._]# Create an empty set with at least the specified `capacity` and `hash` functor; optionally use `basicAllocator`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bdlc/FlatHashSet/2constructor-06.adoc[FlatHashSet]( std::size_t capacity, HASH const& hash, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0); ---- [.small]#xref:BloombergLP/bdlc/FlatHashSet/2constructor-06.adoc[_» more..._]# Same as the preceding overload, also requesting at least the specified `capacity`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bdlc/FlatHashSet/2constructor-0c.adoc[FlatHashSet]( bsl::initializer_list<KEY> values, std::size_t capacity, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0); ---- [.small]#xref:BloombergLP/bdlc/FlatHashSet/2constructor-0c.adoc[_» more..._]# Create a `FlatHashSet` 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 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 verify that 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 is equivalent 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/FlatHashSet/2constructor-0b.adoc[FlatHashSet]( INPUT_ITERATOR first, INPUT_ITERATOR last, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0); ---- [.small]#xref:BloombergLP/bdlc/FlatHashSet/2constructor-0b.adoc[_» more..._]# Create an empty set with at least the specified `capacity`, `hash`, and `equal` predicate; optionally use `basicAllocator`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bdlc/FlatHashSet/2constructor-09.adoc[FlatHashSet]( std::size_t capacity, HASH const& hash, EQUAL const& equal, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0); ---- [.small]#xref:BloombergLP/bdlc/FlatHashSet/2constructor-09.adoc[_» more..._]# Same as the preceding overload, also using the specified `hash`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bdlc/FlatHashSet/2constructor-081.adoc[FlatHashSet]( bsl::initializer_list<KEY> values, std::size_t capacity, HASH const& hash, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0); ---- [.small]#xref:BloombergLP/bdlc/FlatHashSet/2constructor-081.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/FlatHashSet/2constructor-085.adoc[FlatHashSet]( INPUT_ITERATOR first, INPUT_ITERATOR last, std::size_t capacity, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0); ---- [.small]#xref:BloombergLP/bdlc/FlatHashSet/2constructor-085.adoc[_» more..._]# Same as the preceding overload, also using the specified `equal`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bdlc/FlatHashSet/2constructor-080.adoc[FlatHashSet]( bsl::initializer_list<KEY> values, std::size_t capacity, HASH const& hash, EQUAL const& equal, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0); ---- [.small]#xref:BloombergLP/bdlc/FlatHashSet/2constructor-080.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/FlatHashSet/2constructor-0d.adoc[FlatHashSet]( 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/FlatHashSet/2constructor-0d.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/FlatHashSet/2constructor-0f7.adoc[FlatHashSet]( 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/FlatHashSet/2constructor-0f7.adoc[_» more..._]# [.small]#Created with https://www.mrdocs.com[MrDocs]#