Internals: For unordered set, add constant accessor. No functional change.

This commit is contained in:
Wilson Snyder
2018-06-17 10:31:27 -04:00
parent 4c7a397dc4
commit e89cb1b9f7
+5
View File
@@ -511,6 +511,11 @@ template <class Key,
if (it == end()) { throw std::out_of_range("sorry"); }
return it->second;
}
const Value& at(const Key& k) const {
iterator it = find(k);
if (it == end()) { throw std::out_of_range("sorry"); }
return it->second;
}
void clear() { m_set.clear(); }
size_type size() const { return m_set.size(); }
};