mirror of
https://github.com/boostorg/unordered.git
synced 2025-07-29 19:07:15 +02:00
Expand calls to at implementation
This commit is contained in:
@ -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
|
||||
|
@ -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>
|
||||
|
Reference in New Issue
Block a user