Map
get(const T& key, const ValueT& defaultVal) [Map template]
Gets the value of an entry in the map from its key
. If the key does not exist, returns defaultVal
.
This returns a copy of the value, so it's less efficient for complex values. See also operator[]
which returns a reference to the value instead of a copy, and find()
which returns an iterator for the value.
// PROTOTYPE
template<typename T>
ValueT get(const T& key, const ValueT& defaultVal) const;