Template Class UnorderedMap#

Inheritance Relationships#

Base Type#

  • public std::unordered_map< Key, Value >

Class Documentation#

template<typename Key, typename Value>
class UnorderedMap : public std::unordered_map<Key, Value>#

Public Functions

inline bool contains(const Key &key) const#

Check if a key exists in the map.

Parameters

key – Key to search for

Returns

Boolean

inline bool contains(const Key &key, Value &value) const#

Check if a key exists in the map and, if it does, set value to the value of the key. The function returns true if the key exists, false otherwise. (If the function returns false, value will not be modified/initialized, so make sure you check the return value!)

Parameters
  • key – Key to search for

  • value – Value of the key, if it exists (output)

Returns

True if the key exists, false otherwise

inline auto get(const Key &key) const#

Get the value of a key.

Parameters

key – Key to search for

Returns

Value of the key

inline auto get(const Key &key, const Value &defaultValue) const#

Get the value of a key, or a default value if the key does not exist.

Parameters
  • key – Key to search for

  • defaultValue – Default value to return if the key does not exist

Returns

Value of the key, or defaultValue if the key does not exist

inline std::string str(const std::string &keyFormat = "{}", const std::string &valueFormat = "{}") const#