diff --git a/include/boost/unordered/detail/table.hpp b/include/boost/unordered/detail/table.hpp index 198548d3..d37c0155 100644 --- a/include/boost/unordered/detail/table.hpp +++ b/include/boost/unordered/detail/table.hpp @@ -12,6 +12,7 @@ #include #include #include +#include #include @@ -608,15 +609,15 @@ namespace boost { namespace unordered_detail { hash_table::at(key_type const& k) const { if(!this->size_) - throw std::out_of_range("Unable to find key in unordered_map."); + boost::throw_exception(std::out_of_range("Unable to find key in unordered_map.")); bucket_ptr bucket = this->get_bucket(this->bucket_index(k)); node_ptr it = find_iterator(bucket, k); - if (BOOST_UNORDERED_BORLAND_BOOL(it)) - return node::get_value(it); - else - throw std::out_of_range("Unable to find key in unordered_map."); + if (!it) + boost::throw_exception(std::out_of_range("Unable to find key in unordered_map.")); + + return node::get_value(it); } // equal_range