Quick Links:

bal | bbl | bdl | bsl

Public Types | Public Member Functions | Friends

bdlc::FlatHashSet< KEY, HASH, EQUAL > Class Template Reference

#include <bdlc_flathashset.h>

List of all members.

Public Types

typedef KEY key_type
typedef KEY value_type
typedef bsl::size_t size_type
typedef bsl::ptrdiff_t difference_type
typedef EQUAL key_compare
typedef EQUAL value_compare
typedef HASH hasher
typedef value_typereference
typedef const value_typeconst_reference
typedef value_typepointer
typedef const value_typeconst_pointer
typedef ImplType::const_iterator iterator
typedef ImplType::const_iterator const_iterator

Public Member Functions

 FlatHashSet ()
 FlatHashSet (bslma::Allocator *basicAllocator)
 FlatHashSet (bsl::size_t capacity)
 FlatHashSet (bsl::size_t capacity, bslma::Allocator *basicAllocator)
 FlatHashSet (bsl::size_t capacity, const HASH &hash, bslma::Allocator *basicAllocator=0)
 FlatHashSet (bsl::size_t capacity, const HASH &hash, const EQUAL &equal, bslma::Allocator *basicAllocator=0)
template<class INPUT_ITERATOR >
 FlatHashSet (INPUT_ITERATOR first, INPUT_ITERATOR last, bslma::Allocator *basicAllocator=0)
template<class INPUT_ITERATOR >
 FlatHashSet (INPUT_ITERATOR first, INPUT_ITERATOR last, bsl::size_t capacity, bslma::Allocator *basicAllocator=0)
template<class INPUT_ITERATOR >
 FlatHashSet (INPUT_ITERATOR first, INPUT_ITERATOR last, bsl::size_t capacity, const HASH &hash, bslma::Allocator *basicAllocator=0)
template<class INPUT_ITERATOR >
 FlatHashSet (INPUT_ITERATOR first, INPUT_ITERATOR last, bsl::size_t capacity, const HASH &hash, const EQUAL &equal, bslma::Allocator *basicAllocator=0)
 FlatHashSet (bsl::initializer_list< KEY > values, bslma::Allocator *basicAllocator=0)
 FlatHashSet (bsl::initializer_list< KEY > values, bsl::size_t capacity, bslma::Allocator *basicAllocator=0)
 FlatHashSet (bsl::initializer_list< KEY > values, bsl::size_t capacity, const HASH &hash, bslma::Allocator *basicAllocator=0)
 FlatHashSet (bsl::initializer_list< KEY > values, bsl::size_t capacity, const HASH &hash, const EQUAL &equal, bslma::Allocator *basicAllocator=0)
 FlatHashSet (const FlatHashSet &original, bslma::Allocator *basicAllocator=0)
 FlatHashSet (bslmf::MovableRef< FlatHashSet > original)
 FlatHashSet (bslmf::MovableRef< FlatHashSet > original, bslma::Allocator *basicAllocator)
 ~FlatHashSet ()
FlatHashSetoperator= (const FlatHashSet &rhs)
FlatHashSetoperator= (bslmf::MovableRef< FlatHashSet > rhs)
FlatHashSetoperator= (bsl::initializer_list< KEY > values)
void clear ()
bsl::size_t erase (const KEY &key)
const_iterator erase (const_iterator position)
const_iterator erase (const_iterator first, const_iterator last)
template<class KEY_TYPE >
bsl::enable_if
< bsl::is_convertible
< KEY_TYPE, KEY >::value,
bsl::pair< const_iterator,
bool > >::type 
insert (BSLS_COMPILERFEATURES_FORWARD_REF(KEY_TYPE) value)
template<class KEY_TYPE >
bsl::enable_if
< bsl::is_convertible
< KEY_TYPE, KEY >::value,
const_iterator >::type 
insert (const_iterator, BSLS_COMPILERFEATURES_FORWARD_REF(KEY_TYPE) value)
template<class INPUT_ITERATOR >
void insert (INPUT_ITERATOR first, INPUT_ITERATOR last)
void insert (bsl::initializer_list< KEY > values)
void rehash (bsl::size_t minimumCapacity)
void reserve (bsl::size_t numEntries)
void reset ()
void swap (FlatHashSet &other)
bsl::size_t capacity () const
bool contains (const KEY &key) const
bsl::size_t count (const KEY &key) const
bool empty () const
bsl::pair< const_iterator,
const_iterator
equal_range (const KEY &key) const
const_iterator find (const KEY &key) const
HASH hash_function () const
EQUAL key_eq () const
float load_factor () const
float max_load_factor () const
bsl::size_t size () const
const_iterator begin () const
const_iterator cbegin () const
const_iterator cend () const
const_iterator end () const
bslma::Allocatorallocator () const
bsl::ostream & print (bsl::ostream &stream, int level=0, int spacesPerLevel=4) const

Friends

bool operator== (const FlatHashSet &, const FlatHashSet &)
bool operator!= (const FlatHashSet &, const FlatHashSet &)
template<class K , class H , class E >
void swap (FlatHashSet< K, H, E > &, FlatHashSet< K, H, E > &)

Detailed Description

template<class KEY, class HASH, class EQUAL>
class bdlc::FlatHashSet< KEY, HASH, EQUAL >

This class template implements a value-semantic container type holding an unordered set of unique values of (template parameter) type KEY. The (template parameter) type HASH is a functor providing the hash value for KEY. The (template parameter) type EQUAL is a functor providing the equality function for two KEY values. See Requirements on KEY, HASH, and EQUAL for more information.

See Component bdlc_flathashset


Member Typedef Documentation

template<class KEY , class HASH , class EQUAL >
typedef KEY bdlc::FlatHashSet< KEY, HASH, EQUAL >::key_type
template<class KEY , class HASH , class EQUAL >
typedef KEY bdlc::FlatHashSet< KEY, HASH, EQUAL >::value_type
template<class KEY , class HASH , class EQUAL >
typedef bsl::size_t bdlc::FlatHashSet< KEY, HASH, EQUAL >::size_type
template<class KEY , class HASH , class EQUAL >
typedef bsl::ptrdiff_t bdlc::FlatHashSet< KEY, HASH, EQUAL >::difference_type
template<class KEY , class HASH , class EQUAL >
typedef EQUAL bdlc::FlatHashSet< KEY, HASH, EQUAL >::key_compare
template<class KEY , class HASH , class EQUAL >
typedef EQUAL bdlc::FlatHashSet< KEY, HASH, EQUAL >::value_compare
template<class KEY , class HASH , class EQUAL >
typedef HASH bdlc::FlatHashSet< KEY, HASH, EQUAL >::hasher
template<class KEY , class HASH , class EQUAL >
typedef value_type& bdlc::FlatHashSet< KEY, HASH, EQUAL >::reference
template<class KEY , class HASH , class EQUAL >
typedef const value_type& bdlc::FlatHashSet< KEY, HASH, EQUAL >::const_reference
template<class KEY , class HASH , class EQUAL >
typedef value_type* bdlc::FlatHashSet< KEY, HASH, EQUAL >::pointer
template<class KEY , class HASH , class EQUAL >
typedef const value_type* bdlc::FlatHashSet< KEY, HASH, EQUAL >::const_pointer
template<class KEY , class HASH , class EQUAL >
typedef ImplType::const_iterator bdlc::FlatHashSet< KEY, HASH, EQUAL >::iterator
template<class KEY , class HASH , class EQUAL >
typedef ImplType::const_iterator bdlc::FlatHashSet< KEY, HASH, EQUAL >::const_iterator

Constructor & Destructor Documentation

template<class KEY , class HASH , class EQUAL >
bdlc::FlatHashSet< KEY, HASH, EQUAL >::FlatHashSet (  ) 
template<class KEY , class HASH , class EQUAL >
bdlc::FlatHashSet< KEY, HASH, EQUAL >::FlatHashSet ( bslma::Allocator basicAllocator  )  [explicit]
template<class KEY , class HASH , class EQUAL >
bdlc::FlatHashSet< KEY, HASH, EQUAL >::FlatHashSet ( bsl::size_t  capacity  )  [explicit]
template<class KEY , class HASH , class EQUAL >
bdlc::FlatHashSet< KEY, HASH, EQUAL >::FlatHashSet ( bsl::size_t  capacity,
bslma::Allocator basicAllocator 
)
template<class KEY , class HASH , class EQUAL >
bdlc::FlatHashSet< KEY, HASH, EQUAL >::FlatHashSet ( bsl::size_t  capacity,
const HASH &  hash,
bslma::Allocator basicAllocator = 0 
)
template<class KEY , class HASH , class EQUAL >
bdlc::FlatHashSet< KEY, HASH, EQUAL >::FlatHashSet ( bsl::size_t  capacity,
const HASH &  hash,
const EQUAL &  equal,
bslma::Allocator basicAllocator = 0 
)

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.

template<class KEY , class HASH , class EQUAL >
template<class INPUT_ITERATOR >
bdlc::FlatHashSet< KEY, HASH, EQUAL >::FlatHashSet ( INPUT_ITERATOR  first,
INPUT_ITERATOR  last,
bslma::Allocator basicAllocator = 0 
)
template<class KEY , class HASH , class EQUAL >
template<class INPUT_ITERATOR >
bdlc::FlatHashSet< KEY, HASH, EQUAL >::FlatHashSet ( INPUT_ITERATOR  first,
INPUT_ITERATOR  last,
bsl::size_t  capacity,
bslma::Allocator basicAllocator = 0 
)
template<class KEY , class HASH , class EQUAL >
template<class INPUT_ITERATOR >
bdlc::FlatHashSet< KEY, HASH, EQUAL >::FlatHashSet ( INPUT_ITERATOR  first,
INPUT_ITERATOR  last,
bsl::size_t  capacity,
const HASH &  hash,
bslma::Allocator basicAllocator = 0 
)
template<class KEY , class HASH , class EQUAL >
template<class INPUT_ITERATOR >
bdlc::FlatHashSet< KEY, HASH, EQUAL >::FlatHashSet ( INPUT_ITERATOR  first,
INPUT_ITERATOR  last,
bsl::size_t  capacity,
const HASH &  hash,
const EQUAL &  equal,
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 KEY , class HASH , class EQUAL >
bdlc::FlatHashSet< KEY, HASH, EQUAL >::FlatHashSet ( bsl::initializer_list< KEY >  values,
bslma::Allocator basicAllocator = 0 
)
template<class KEY , class HASH , class EQUAL >
bdlc::FlatHashSet< KEY, HASH, EQUAL >::FlatHashSet ( bsl::initializer_list< KEY >  values,
bsl::size_t  capacity,
bslma::Allocator basicAllocator = 0 
)
template<class KEY , class HASH , class EQUAL >
bdlc::FlatHashSet< KEY, HASH, EQUAL >::FlatHashSet ( bsl::initializer_list< KEY >  values,
bsl::size_t  capacity,
const HASH &  hash,
bslma::Allocator basicAllocator = 0 
)
template<class KEY , class HASH , class EQUAL >
bdlc::FlatHashSet< KEY, HASH, EQUAL >::FlatHashSet ( bsl::initializer_list< KEY >  values,
bsl::size_t  capacity,
const HASH &  hash,
const EQUAL &  equal,
bslma::Allocator basicAllocator = 0 
)

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.

template<class KEY , class HASH , class EQUAL >
bdlc::FlatHashSet< KEY, HASH, EQUAL >::FlatHashSet ( const FlatHashSet< KEY, HASH, EQUAL > &  original,
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.

template<class KEY , class HASH , class EQUAL >
bdlc::FlatHashSet< KEY, HASH, EQUAL >::FlatHashSet ( bslmf::MovableRef< FlatHashSet< KEY, HASH, EQUAL > >  original  ) 

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.

template<class KEY , class HASH , class EQUAL >
bdlc::FlatHashSet< KEY, HASH, EQUAL >::FlatHashSet ( bslmf::MovableRef< FlatHashSet< KEY, HASH, EQUAL > >  original,
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).

template<class KEY , class HASH , class EQUAL >
bdlc::FlatHashSet< KEY, HASH, EQUAL >::~FlatHashSet (  ) 

Destroy this object and each of its elements.


Member Function Documentation

template<class KEY , class HASH , class EQUAL >
FlatHashSet& bdlc::FlatHashSet< KEY, HASH, EQUAL >::operator= ( const FlatHashSet< KEY, HASH, EQUAL > &  rhs  ) 

Assign to this object the value, hasher, and equality functor of the specified rhs object, and return a reference providing modifiable access to this object.

template<class KEY , class HASH , class EQUAL >
FlatHashSet& bdlc::FlatHashSet< KEY, HASH, EQUAL >::operator= ( bslmf::MovableRef< FlatHashSet< KEY, HASH, EQUAL > >  rhs  ) 

Assign to this object the value, hasher, and equality comparator of the specified rhs object, and return a reference providing modifiable access to this object. If this object and rhs use the same allocator the contents of rhs are moved (in constant time) to this object. rhs is left in a (valid) unspecified state.

template<class KEY , class HASH , class EQUAL >
FlatHashSet& bdlc::FlatHashSet< KEY, HASH, EQUAL >::operator= ( bsl::initializer_list< KEY >  values  ) 

Assign to this object the value resulting from first clearing this set and then inserting each object in the specified values initializer list, ignoring those objects having a value equivalent to that which appears earlier in the list; return a reference providing modifiable access to this object. This method requires that the (template parameter) type KEY be copy-insertable into this set (see Requirements on KEY, HASH, and EQUAL).

template<class KEY , class HASH , class EQUAL >
void bdlc::FlatHashSet< KEY, HASH, EQUAL >::clear (  ) 

Remove all elements from this set. Note that this set will be empty after calling this method, but allocated memory may be retained for future use. See the capacity method.

template<class KEY , class HASH , class EQUAL >
bsl::size_t bdlc::FlatHashSet< KEY, HASH, EQUAL >::erase ( const KEY &  key  ) 

Remove from this set the element whose key is equal to the specified key, if it exists, and return 1; otherwise (there is no element having key in this set), return 0 with no other effect. This method invalidates all iterators and references to the removed element.

template<class KEY , class HASH , class EQUAL >
const_iterator bdlc::FlatHashSet< KEY, HASH, EQUAL >::erase ( const_iterator  position  ) 

Remove from this set the element at the specified position, and return a const_iterator referring to the element immediately following the removed element, or to the past-the-end position if the removed element was the last element in the sequence of elements maintained by this set. This method invalidates all iterators and references to the removed element. The behavior is undefined unless position refers to an element in this set.

template<class KEY , class HASH , class EQUAL >
const_iterator bdlc::FlatHashSet< KEY, HASH, EQUAL >::erase ( const_iterator  first,
const_iterator  last 
)

Remove from this set the elements starting at the specified first position up to, but not including, the specified last position, and return last. This method invalidates all iterators and references to the removed elements. The behavior is undefined unless first and last are valid iterators on this set, and the first position is at or before the last position in the iteration sequence provided by this container.

template<class KEY , class HASH , class EQUAL >
template<class KEY_TYPE >
bsl::enable_if<bsl::is_convertible<KEY_TYPE, KEY>::value, bsl::pair<const_iterator, bool> >::type bdlc::FlatHashSet< KEY, HASH, EQUAL >::insert ( BSLS_COMPILERFEATURES_FORWARD_REF(KEY_TYPE)  value  )  [inline]
Parameters:
value Insert the specified value into this set if the value does not already exist in this set; otherwise, this method has no effect. Return a pair whose first member is a const_iterator referring to the (possibly newly inserted) element in this set whose value is equivalent to that of the element to be inserted, and whose second member is true if a new element was inserted, and false if an equivalent value was already present.

References BSLS_COMPILERFEATURES_FORWARD, and bdlc::FlatHashTable< KEY, ENTRY, ENTRY_UTIL, HASH, EQUAL >::insert().

template<class KEY , class HASH , class EQUAL >
template<class KEY_TYPE >
bsl::enable_if<bsl::is_convertible<KEY_TYPE, KEY>::value, const_iterator>::type bdlc::FlatHashSet< KEY, HASH, EQUAL >::insert ( const_iterator  ,
BSLS_COMPILERFEATURES_FORWARD_REF(KEY_TYPE)  value 
) [inline]
Parameters:
value Insert the specified value into this set if the value does not already exist in this set; otherwise, this method has no effect. Return a const_iterator referring to the (possibly newly inserted) element in this set whose value is equivalent to that of the element to be inserted. The supplied const_iterator is ignored.

References BSLS_COMPILERFEATURES_FORWARD, and bdlc::FlatHashTable< KEY, ENTRY, ENTRY_UTIL, HASH, EQUAL >::insert().

template<class KEY , class HASH , class EQUAL >
template<class INPUT_ITERATOR >
void bdlc::FlatHashSet< KEY, HASH, EQUAL >::insert ( INPUT_ITERATOR  first,
INPUT_ITERATOR  last 
)

Insert into this set the value of each element in the input iterator range specified by first through last (including first, excluding last). 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 KEY , class HASH , class EQUAL >
void bdlc::FlatHashSet< KEY, HASH, EQUAL >::insert ( bsl::initializer_list< KEY >  values  ) 

Insert into this set an element having the value of each object in the specified values initializer list if an equivalent value is not already contained in this set. This method requires that the (template parameter) type KEY be copy-insertable (see Requirements on KEY, HASH, and EQUAL).

template<class KEY , class HASH , class EQUAL >
void bdlc::FlatHashSet< KEY, HASH, EQUAL >::rehash ( bsl::size_t  minimumCapacity  ) 

Change the capacity of this set to at least the specified minimumCapacity, and redistribute all the contained elements into a new sequence of entries according to their hash values. If 0 == minimumCapacity and 0 == size(), the set is returned to the default constructed state. After this call, load_factor() will be less than or equal to max_load_factor() and all iterators, pointers, and references to elements of this set are invalidated.

template<class KEY , class HASH , class EQUAL >
void bdlc::FlatHashSet< KEY, HASH, EQUAL >::reserve ( bsl::size_t  numEntries  ) 

Change the capacity of this set to at least a capacity that can accommodate the specified numEntries (accounting for the load factor invariant), and redistribute all the contained elements into a new sequence of entries according to their hash values. If 0 == numEntries and 0 == size(), the set is returned to the default constructed state. After this call, load_factor() will be less than or equal to max_load_factor() and all iterators, pointers, and references to elements of this set are invalidated. Note that this method is effectively equivalent to:

             rehash(bsl::ceil(numEntries / max_load_factor()))
template<class KEY , class HASH , class EQUAL >
void bdlc::FlatHashSet< KEY, HASH, EQUAL >::reset (  ) 

Remove all elements from this set and release all memory from this set, returning the set to the default constructed state.

template<class KEY , class HASH , class EQUAL >
void bdlc::FlatHashSet< KEY, HASH, EQUAL >::swap ( FlatHashSet< KEY, HASH, EQUAL > &  other  ) 

Exchange the value of this object as well as its hasher and equality functors with those of the specified other object. The behavior is undefined unless this object was created with the same allocator as other.

template<class KEY , class HASH , class EQUAL >
bsl::size_t bdlc::FlatHashSet< KEY, HASH, EQUAL >::capacity (  )  const

Return the number of elements this set could hold if the load factor were 1.

template<class KEY , class HASH , class EQUAL >
bool bdlc::FlatHashSet< KEY, HASH, EQUAL >::contains ( const KEY &  key  )  const

Return true if this set contains an element having the specified key, and false otherwise.

template<class KEY , class HASH , class EQUAL >
bsl::size_t bdlc::FlatHashSet< KEY, HASH, EQUAL >::count ( const KEY &  key  )  const

Return the number of elements in this set having the specified key. Note that since a flat hash set maintains unique keys, the returned value will be either 0 or 1.

template<class KEY , class HASH , class EQUAL >
bool bdlc::FlatHashSet< KEY, HASH, EQUAL >::empty (  )  const

Return true if this set contains no elements, and false otherwise.

template<class KEY , class HASH , class EQUAL >
bsl::pair<const_iterator, const_iterator> bdlc::FlatHashSet< KEY, HASH, EQUAL >::equal_range ( const KEY &  key  )  const

Return a pair of const_iterators defining the sequence of elements in this set having the specified key, where the first iterator is positioned at the start of the sequence and the second iterator is positioned one past the end of the sequence. If this set contains no KEY elements equivalent to key, then the two returned iterators will have the same value. Note that since a set maintains unique keys, the range will contain at most one element.

template<class KEY , class HASH , class EQUAL >
const_iterator bdlc::FlatHashSet< KEY, HASH, EQUAL >::find ( const KEY &  key  )  const

Return a const_iterator referring to the element in this set having the specified key, or end() if no such entry exists in this set.

template<class KEY , class HASH , class EQUAL >
HASH bdlc::FlatHashSet< KEY, HASH, EQUAL >::hash_function (  )  const

Return (a copy of) the unary hash functor used by this set to generate a hash value (of type bsl::size_t) for a KEY object.

template<class KEY , class HASH , class EQUAL >
EQUAL bdlc::FlatHashSet< KEY, HASH, EQUAL >::key_eq (  )  const

Return (a copy of) the binary key-equality functor that returns true if the value of two KEY objects are equivalent, and false otherwise.

template<class KEY , class HASH , class EQUAL >
float bdlc::FlatHashSet< KEY, HASH, EQUAL >::load_factor (  )  const

Return the current ratio between the number of elements in this container and its capacity.

template<class KEY , class HASH , class EQUAL >
float bdlc::FlatHashSet< KEY, HASH, EQUAL >::max_load_factor (  )  const

Return the maximum load factor allowed for this set. Note that if an insert operation would cause the load factor to exceed max_load_factor(), that same insert operation will increase the capacity and rehash the entries of the container (see Load Factor and Resizing). Also note that the value returned by max_load_factor is implementation defined and cannot be changed by the user.

template<class KEY , class HASH , class EQUAL >
bsl::size_t bdlc::FlatHashSet< KEY, HASH, EQUAL >::size (  )  const

Return the number of elements in this set.

template<class KEY , class HASH , class EQUAL >
const_iterator bdlc::FlatHashSet< KEY, HASH, EQUAL >::begin (  )  const

Return a const_iterator to the first element in the sequence of elements maintained by this set, or the end iterator if this set is empty.

template<class KEY , class HASH , class EQUAL >
const_iterator bdlc::FlatHashSet< KEY, HASH, EQUAL >::cbegin (  )  const

Return a const_iterator to the first element in the sequence of elements maintained by this set, or the end iterator if this set is empty.

template<class KEY , class HASH , class EQUAL >
const_iterator bdlc::FlatHashSet< KEY, HASH, EQUAL >::cend (  )  const

Return a const_iterator to the past-the-end element in the sequence of KEY elements maintained by this set.

template<class KEY , class HASH , class EQUAL >
const_iterator bdlc::FlatHashSet< KEY, HASH, EQUAL >::end (  )  const

Return a const_iterator to the past-the-end element in the sequence of KEY elements maintained by this set.

template<class KEY , class HASH , class EQUAL >
bslma::Allocator* bdlc::FlatHashSet< KEY, HASH, EQUAL >::allocator (  )  const

Return the allocator used by this flat hash set to supply memory.

template<class KEY , class HASH , class EQUAL >
bsl::ostream& bdlc::FlatHashSet< KEY, HASH, EQUAL >::print ( bsl::ostream &  stream,
int  level = 0,
int  spacesPerLevel = 4 
) const

Format this object to the specified output stream at the (absolute value of) the optionally specified indentation level, and return a reference to the modifiable stream. If level is specified, optionally specify spacesPerLevel, the number of spaces per indentation level for this and all of its nested objects. If level is negative, suppress indentation of the first line. If spacesPerLevel is negative, format the entire output on one line, suppressing all but the initial indentation (as governed by level). If stream is not valid on entry, this operation has no effect.


Friends And Related Function Documentation

template<class KEY , class HASH , class EQUAL >
bool operator== ( const FlatHashSet< KEY, HASH, EQUAL > &  ,
const FlatHashSet< KEY, HASH, EQUAL > &   
) [friend]

Return true if the specified lhs and rhs objects have the same value, and false otherwise. Two FlatHashSet objects have the same value if their sizes are the same and each element contained in one is equal to an element of the other. The hash and equality functors are not involved in the comparison.

template<class KEY , class HASH , class EQUAL >
bool operator!= ( const FlatHashSet< KEY, HASH, EQUAL > &  ,
const FlatHashSet< KEY, HASH, EQUAL > &   
) [friend]

Return true if the specified lhs and rhs objects do not have the same value, and false otherwise. Two FlatHashSet objects do not have the same value if their sizes are different or one contains an element equal to no element of the other. The hash and equality functors are not involved in the comparison.

template<class KEY , class HASH , class EQUAL >
template<class K , class H , class E >
void swap ( FlatHashSet< K, H, E > &  ,
FlatHashSet< K, H, E > &   
) [friend]

The documentation for this class was generated from the following file: