template<typename T>
slang::StringTable class

This class is a lookup table from string to value. It's optimized for a known fixed set of keywords.

Constructors, destructors, conversion operators

StringTable(std::initializer_list<std::pair<string_view, T>> entries)

Public functions

auto lookup(string_view key, T& value) const -> bool

Function documentation

template<typename T>
slang::StringTable<T>::StringTable(std::initializer_list<std::pair<string_view, T>> entries)

Constructs the string table with all possible entries (key / values) already provided. No other entries can be added after construction.

template<typename T>
bool slang::StringTable<T>::lookup(string_view key, T& value) const

Returns true if the element is found, and false otherwise.

Looks for an entry with the given key and sets value if found.