Return the first node in anchor that matches key, or null.

Synopsis

Declared in <bslalg_hashtableimputil.h>

template<
    class KEY_CONFIG,
    class KEY_EQUAL>
static
BidirectionalLink*
find(
    HashTableAnchor const& anchor,
    HashTableImpUtil_ExtractKeyResult<KEY_CONFIG>::Type key,
    KEY_EQUAL const& equalityFunctor,
    std::size_t hashCode);

Description

Return the address of the first link in the list element of the specified anchor, having a value matching (according to the specified equalityFunctor) the specified key in the bucket that holds elements with the specified hashCode if such a link exists, and return 0 otherwise. The behavior is undefined unless, for the provided KEY_CONFIG and some hash function, HASHER, anchor is well‐formed (see isWellFormed) and HASHER(key) returns hashCode. KEY_CONFIG shall be a namespace providing the type names KeyType and ValueType, as well as a function that can be called as if it had the following signature: ` const KeyType& extractKey(const ValueType& obj); ` KEY_EQUAL shall be a functor that can be called as if it had the following signature: ` bool operator()(const KEY_CONFIG::KeyType& key1, const KEY_CONFIG::KeyType& key2) `

Return Value

address of the matching link, or 0 if none

Parameters

Name

Description

anchor

hash table to search

key

key value to match against stored keys

equalityFunctor

predicate comparing key to stored keys

hashCode

non‐adjusted hash code of key

Created with MrDocs