mdds::sorted_string_map¶sorted_string_map provides an efficient way to map string keys to arbitrary values, provided that the keys are known at compile time and are sorted in ascending order.
Public Functions
sorted_string_map(const entry *entries, size_type entry_size, value_type null_value)¶Constructor.
entries - pointer to the array of key-value entries.
entry_size - size of the key-value entry array.
null_value - null value to return when the find method fails to find a matching entry.
find(const char *input, size_type len) const¶Find a value associated with a specified string key.
input - pointer to a C-style string whose value represents the key to match.
len - length of the matching string value.
entry¶Single key-value entry. Caller must provide at compile time a static array of these entries.