Return a pointer to the datum with the specified key, or null.

Synopsis

Declared in <bdld_datum.h>

Datum const*
find(bslstl::StringRef const& key) const;

Description

Return a const pointer to the datum having the specified key, if it exists and 0 otherwise. Note that the find has order of O(n) if the data is not sorted based on the keys. If the data is sorted, it has order of O(log(n)). Also note that if multiple entries with matching keys are present, which matching record is found is unspecified.

Return Value

a pointer to the datum with the specified key, or null

Parameters

Name

Description

key

string key to look up

Created with MrDocs