Internals: For unordered set, add constant accessor. No functional change.
This commit is contained in:
parent
4c7a397dc4
commit
e89cb1b9f7
|
|
@ -511,6 +511,11 @@ template <class Key,
|
||||||
if (it == end()) { throw std::out_of_range("sorry"); }
|
if (it == end()) { throw std::out_of_range("sorry"); }
|
||||||
return it->second;
|
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(); }
|
void clear() { m_set.clear(); }
|
||||||
size_type size() const { return m_set.size(); }
|
size_type size() const { return m_set.size(); }
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue