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.

Create an empty set with at least the specified capacity.

explicit
FlatHashSet(std::size_t capacity);

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.

Create an empty set using the specified basicAllocator.

explicit
FlatHashSet(bslma::Allocator* basicAllocator);

Create an empty set with at least the specified capacity, using the specified basicAllocator.

FlatHashSet(
    std::size_t capacity,
    bslma::Allocator* basicAllocator);

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).

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.

FlatHashSet(
    bsl::initializer_list<KEY> values,
    bslma::Allocator* basicAllocator = 0);

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.

FlatHashSet(
    FlatHashSet const& original,
    bslma::Allocator* basicAllocator = 0);

Create an empty set with at least the specified capacity and hash functor; optionally use basicAllocator.

FlatHashSet(
    std::size_t capacity,
    HASH const& hash,
    bslma::Allocator* basicAllocator = 0);

Same as the preceding overload, also requesting at least the specified capacity.

FlatHashSet(
    bsl::initializer_list<KEY> values,
    std::size_t capacity,
    bslma::Allocator* basicAllocator = 0);

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.

template<class INPUT_ITERATOR>
FlatHashSet(
    INPUT_ITERATOR first,
    INPUT_ITERATOR last,
    bslma::Allocator* basicAllocator = 0);

Create an empty set with at least the specified capacity, hash, and equal predicate; optionally use basicAllocator.

FlatHashSet(
    std::size_t capacity,
    HASH const& hash,
    EQUAL const& equal,
    bslma::Allocator* basicAllocator = 0);

Same as the preceding overload, also using the specified hash.

FlatHashSet(
    bsl::initializer_list<KEY> values,
    std::size_t capacity,
    HASH const& hash,
    bslma::Allocator* basicAllocator = 0);

Same as the preceding overload, also requesting at least the specified capacity.

template<class INPUT_ITERATOR>
FlatHashSet(
    INPUT_ITERATOR first,
    INPUT_ITERATOR last,
    std::size_t capacity,
    bslma::Allocator* basicAllocator = 0);

Same as the preceding overload, also using the specified equal.

FlatHashSet(
    bsl::initializer_list<KEY> values,
    std::size_t capacity,
    HASH const& hash,
    EQUAL const& equal,
    bslma::Allocator* basicAllocator = 0);

Same as the preceding overload, also using the specified hash.

template<class INPUT_ITERATOR>
FlatHashSet(
    INPUT_ITERATOR first,
    INPUT_ITERATOR last,
    std::size_t capacity,
    HASH const& hash,
    bslma::Allocator* basicAllocator = 0);

Same as the preceding overload, also using the specified equal.

template<class INPUT_ITERATOR>
FlatHashSet(
    INPUT_ITERATOR first,
    INPUT_ITERATOR last,
    std::size_t capacity,
    HASH const& hash,
    EQUAL const& equal,
    bslma::Allocator* basicAllocator = 0);

Created with MrDocs