Expand calls to at implementation

This commit is contained in:
Daniel James
2017-04-23 10:09:18 +01:00
parent 4f1c6e1ebf
commit 7941771d61
2 changed files with 16 additions and 16 deletions

View File

@ -3759,20 +3759,6 @@ struct table_unique : boost::unordered::detail::table<Types>
}
}
// Accessors
value_type& at(const_key_type& k) const
{
if (this->size_) {
node_pointer n = this->find_node(k);
if (n)
return n->value();
}
boost::throw_exception(
std::out_of_range("Unable to find key in unordered_map."));
}
// equals
bool equals(table_unique const& other) const

View File

@ -1723,14 +1723,28 @@ template <class K, class T, class H, class P, class A>
typename unordered_map<K, T, H, P, A>::mapped_type&
unordered_map<K, T, H, P, A>::at(const key_type& k)
{
return table_.at(k).second;
if (table_.size_) {
node_pointer n = table_.find_node(k);
if (n)
return n->value().second;
}
boost::throw_exception(
std::out_of_range("Unable to find key in unordered_map."));
}
template <class K, class T, class H, class P, class A>
typename unordered_map<K, T, H, P, A>::mapped_type const&
unordered_map<K, T, H, P, A>::at(const key_type& k) const
{
return table_.at(k).second;
if (table_.size_) {
node_pointer n = table_.find_node(k);
if (n)
return n->value().second;
}
boost::throw_exception(
std::out_of_range("Unable to find key in unordered_map."));
}
template <class K, class T, class H, class P, class A>