[#bsl-unordered_set-0d2d-2constructor-059] = xref:bsl.adoc[bsl]::xref:bsl/unordered_set-0d2d.adoc[unordered_set]::unordered_set :relfileprefix: ../../ :mrdocs: Constructors == Synopses Declared in `<bslstl_unorderedset.h>` Create an empty unordered set. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/unordered_set-0d2d/2constructor-00.adoc[unordered_set](); ---- [.small]#xref:bsl/unordered_set-0d2d/2constructor-00.adoc[_» more..._]# Create an unordered set having the same value as the specified `original`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/unordered_set-0d2d/2constructor-053.adoc[unordered_set](xref:bsl/unordered_set-0d2d.adoc[unordered_set] const& original); ---- [.small]#xref:bsl/unordered_set-0d2d/2constructor-053.adoc[_» more..._]# Create an unordered set by moving the contents of the specified `original`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/unordered_set-0d2d/2constructor-013.adoc[unordered_set](xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef<unordered_set>] original); ---- [.small]#xref:bsl/unordered_set-0d2d/2constructor-013.adoc[_» more..._]# Create an empty unordered set using the specified `basicAllocator`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- explicit xref:bsl/unordered_set-0d2d/2constructor-0a6.adoc[unordered_set](ALLOCATOR const& basicAllocator); ---- [.small]#xref:bsl/unordered_set-0d2d/2constructor-0a6.adoc[_» more..._]# Create an empty unordered set with the specified parameters. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/unordered_set-0d2d/2constructor-0d.adoc[unordered_set]( xref:bsl/unordered_set-0d2d/size_type.adoc[size_type] initialNumBuckets, ALLOCATOR const& basicAllocator); ---- [.small]#xref:bsl/unordered_set-0d2d/2constructor-0d.adoc[_» more..._]# Create an unordered set by moving `original`, using `basicAllocator`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/unordered_set-0d2d/2constructor-056.adoc[unordered_set]( xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef<unordered_set>] original, ALLOCATOR const& basicAllocator); ---- [.small]#xref:bsl/unordered_set-0d2d/2constructor-056.adoc[_» more..._]# Create an unordered set having the same value as the specified `original` object that uses the specified `basicAllocator` to supply memory. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/unordered_set-0d2d/2constructor-07.adoc[unordered_set]( xref:bsl/unordered_set-0d2d.adoc[unordered_set] const& original, ALLOCATOR const& basicAllocator); ---- [.small]#xref:bsl/unordered_set-0d2d/2constructor-07.adoc[_» more..._]# Create an unordered set from the specified `values` initializer list. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class = void> requires bsl::IsStdAllocator<ALLOCATOR>::value xref:bsl/unordered_set-0d2d/2constructor-0c.adoc[unordered_set]( std::initializer_list<KEY> values, ALLOCATOR const& basicAllocator); ---- [.small]#xref:bsl/unordered_set-0d2d/2constructor-0c.adoc[_» more..._]# Create an empty unordered set with the specified parameters. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/unordered_set-0d2d/2constructor-06.adoc[unordered_set]( xref:bsl/unordered_set-0d2d/size_type.adoc[size_type] initialNumBuckets, HASH const& hashFunction, ALLOCATOR const& basicAllocator); ---- [.small]#xref:bsl/unordered_set-0d2d/2constructor-06.adoc[_» more..._]# Create an unordered set from the specified iterator range. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class INPUT_ITERATOR> xref:bsl/unordered_set-0d2d/2constructor-0a8.adoc[unordered_set]( INPUT_ITERATOR first, INPUT_ITERATOR last, ALLOCATOR const& basicAllocator); ---- [.small]#xref:bsl/unordered_set-0d2d/2constructor-0a8.adoc[_» more..._]# Create an unordered set from the specified `range`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class RANGE> xref:bsl/unordered_set-0d2d/2constructor-02f.adoc[unordered_set]( std::from_range_t tag, RANGE&& range, ALLOCATOR const& basicAllocator); ---- [.small]#xref:bsl/unordered_set-0d2d/2constructor-02f.adoc[_» more..._]# Create an unordered set from the specified `values` initializer list. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class = void> requires bsl::IsStdAllocator<ALLOCATOR>::value xref:bsl/unordered_set-0d2d/2constructor-030e.adoc[unordered_set]( std::initializer_list<KEY> values, xref:bsl/unordered_set-0d2d/size_type.adoc[size_type] initialNumBuckets, ALLOCATOR const& basicAllocator); ---- [.small]#xref:bsl/unordered_set-0d2d/2constructor-030e.adoc[_» more..._]# Create an empty unordered set with the specified bucket count. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- explicit xref:bsl/unordered_set-0d2d/2constructor-015.adoc[unordered_set]( xref:bsl/unordered_set-0d2d/size_type.adoc[size_type] initialNumBuckets, HASH const& hashFunction = HASH(), EQUAL const& keyEqual = EQUAL(), ALLOCATOR const& basicAllocator = ALLOCATOR()); ---- [.small]#xref:bsl/unordered_set-0d2d/2constructor-015.adoc[_» more..._]# Create an unordered set from the specified iterator range. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class INPUT_ITERATOR> xref:bsl/unordered_set-0d2d/2constructor-0f.adoc[unordered_set]( INPUT_ITERATOR first, INPUT_ITERATOR last, xref:bsl/unordered_set-0d2d/size_type.adoc[size_type] initialNumBuckets, ALLOCATOR const& basicAllocator); ---- [.small]#xref:bsl/unordered_set-0d2d/2constructor-0f.adoc[_» more..._]# Create an unordered set from the specified `range`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class RANGE> xref:bsl/unordered_set-0d2d/2constructor-030d.adoc[unordered_set]( std::from_range_t tag, RANGE&& range, xref:bsl/unordered_set-0d2d/size_type.adoc[size_type] initialNumBuckets, ALLOCATOR const& basicAllocator); ---- [.small]#xref:bsl/unordered_set-0d2d/2constructor-030d.adoc[_» more..._]# Create an unordered set from the specified `values` initializer list. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class = void, class = void> requires std::is_invocable_v<HASH, const KEY &> && bsl::IsStdAllocator<ALLOCATOR>::value xref:bsl/unordered_set-0d2d/2constructor-025.adoc[unordered_set]( std::initializer_list<KEY> values, xref:bsl/unordered_set-0d2d/size_type.adoc[size_type] initialNumBuckets, HASH const& hashFunction, ALLOCATOR const& basicAllocator); ---- [.small]#xref:bsl/unordered_set-0d2d/2constructor-025.adoc[_» more..._]# Create an unordered set from the specified iterator range. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class INPUT_ITERATOR> xref:bsl/unordered_set-0d2d/2constructor-0b.adoc[unordered_set]( INPUT_ITERATOR first, INPUT_ITERATOR last, xref:bsl/unordered_set-0d2d/size_type.adoc[size_type] initialNumBuckets, HASH const& hashFunction, ALLOCATOR const& basicAllocator); ---- [.small]#xref:bsl/unordered_set-0d2d/2constructor-0b.adoc[_» more..._]# Create an unordered set from the specified `range`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class RANGE> xref:bsl/unordered_set-0d2d/2constructor-010.adoc[unordered_set]( std::from_range_t tag, RANGE&& range, xref:bsl/unordered_set-0d2d/size_type.adoc[size_type] initialNumBuckets, HASH const& hashFunction, ALLOCATOR const& basicAllocator); ---- [.small]#xref:bsl/unordered_set-0d2d/2constructor-010.adoc[_» more..._]# Create an unordered set from the specified `values` initializer list. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class = void, class = void, class = void> requires std::is_invocable_v<HASH, const KEY &> && std::is_invocable_v<EQUAL, const KEY &, const KEY &> && bsl::IsStdAllocator_v<ALLOCATOR> xref:bsl/unordered_set-0d2d/2constructor-09.adoc[unordered_set]( std::initializer_list<KEY> values, xref:bsl/unordered_set-0d2d/size_type.adoc[size_type] initialNumBuckets = 0, HASH const& hashFunction = HASH(), EQUAL const& keyEqual = EQUAL(), ALLOCATOR const& basicAllocator = ALLOCATOR()); ---- [.small]#xref:bsl/unordered_set-0d2d/2constructor-09.adoc[_» more..._]# Create an unordered set from the specified iterator range. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class INPUT_ITERATOR> xref:bsl/unordered_set-0d2d/2constructor-03c.adoc[unordered_set]( INPUT_ITERATOR first, INPUT_ITERATOR last, xref:bsl/unordered_set-0d2d/size_type.adoc[size_type] initialNumBuckets = 0, HASH const& hashFunction = HASH(), EQUAL const& keyEqual = EQUAL(), ALLOCATOR const& basicAllocator = ALLOCATOR()); ---- [.small]#xref:bsl/unordered_set-0d2d/2constructor-03c.adoc[_» more..._]# Create an unordered set from the specified `range`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class RANGE> xref:bsl/unordered_set-0d2d/2constructor-02e.adoc[unordered_set]( std::from_range_t tag, RANGE&& range, xref:bsl/unordered_set-0d2d/size_type.adoc[size_type] initialNumBuckets = 0, HASH const& hashFunction = HASH(), EQUAL const& keyEqual = EQUAL(), ALLOCATOR const& basicAllocator = ALLOCATOR()); ---- [.small]#xref:bsl/unordered_set-0d2d/2constructor-02e.adoc[_» more..._]# == Parameters [cols="1,4"] |=== | Name| Description | *original* | source unordered set | *basicAllocator* | allocator used to supply memory | *initialNumBuckets* | initial number of buckets | *values* | initializer list of values | *hashFunction* | hash function | *first* | the start of the iterator range | *last* | one past the end of the iterator range | *tag* | disambiguation tag for the range constructor | *range* | range of values to insert | *keyEqual* | key‐equality functor |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#