swap overloads

Synopses

Declared in <bslstl_bidirectionalnodepool.h>

Swap the functor wrapped by the specified lhs object with the functor wrapped by the specified rhs object.

Swap the functor wrapped by the specified a object with the functor wrapped by the specified b object.

template<class FUNCTOR>
void
swap(
    HashTable_HashWrapper<FUNCTOR>& a,
    HashTable_HashWrapper<FUNCTOR>& b);

Efficiently exchange the nodes of the specified a object with those of the specified b object. This method provides the no‐throw exception‐safety guarantee. The behavior is undefined unless a.allocator() == b.allocator().

template<
    class VALUE,
    class ALLOCATOR>
void
swap(
    BidirectionalNodePool<VALUE, ALLOCATOR>& a,
    BidirectionalNodePool<VALUE, ALLOCATOR>& b);

Efficiently exchange the values of the specified a and b objects. This function provides the no‐throw exception‐safety guarantee.

template<
    class KEY,
    class COMPARATOR>
void
swap(
    SetComparator<KEY, COMPARATOR>& a,
    SetComparator<KEY, COMPARATOR>& b);

Efficiently exchange the values of the specified a and b objects. This function provides the no‐throw exception‐safety guarantee.

template<
    class KEY,
    class VALUE,
    class COMPARATOR>
void
swap(
    MapComparator<KEY, VALUE, COMPARATOR>& a,
    MapComparator<KEY, VALUE, COMPARATOR>& b);

Swap both the value, the hasher, the comparator, and the maxLoadFactor of the specified x object with the value, the hasher, the comparator, and the maxLoadFactor of the specified y object. Additionally, if bslstl::AllocatorTraits<ALLOCATOR>::propagate_on_container_swap is true, then exchange the allocator of x with that of y, and do not modify either allocator otherwise. This method guarantees O[1] complexity if x and y have the same allocator or if the allocators propagate on swap, otherwise this operation will typically pay the cost of two copy constructors, which may in turn throw. If the allocators are the same or propagate, then this method provides the no‐throw exception‐safety guarantee unless the swap function of the hasher or comparator throw. Otherwise this method offers only the basic exception safety guarantee.

template<
    class KEY_CONFIG,
    class HASHER,
    class COMPARATOR,
    class ALLOCATOR>
void
swap(
    HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>& x,
    HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>& y);

Created with MrDocs