From 14550beb3b7b97195e483fb74b5efb906395c31e Mon Sep 17 00:00:00 2001 From: Abseil Team Date: Tue, 30 Jul 2019 20:47:29 -0700 Subject: Export of internal Abseil changes. -- 8f685654a7d04eb8a0cb82d31e44e391e906b609 by Derek Mauro : Support constexpr construction of absl::string_view from a string literal in MSVC 2017+. Fixes https://github.com/abseil/abseil-cpp/issues/352 PiperOrigin-RevId: 260853160 -- a3c4c5168ce2a491134d7c87cf7fdc75d1ee2533 by Derek Mauro : Make SwissTable's at() throw when exceptions are enabled Fixes https://github.com/abseil/abseil-cpp/issues/355 PiperOrigin-RevId: 260788026 GitOrigin-RevId: 8f685654a7d04eb8a0cb82d31e44e391e906b609 Change-Id: I9ed498e181faa9c9d16e9b1b01404969d99b8ea9 --- absl/container/internal/raw_hash_map.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'absl/container/internal/raw_hash_map.h') diff --git a/absl/container/internal/raw_hash_map.h b/absl/container/internal/raw_hash_map.h index 0014cf80..6a9c730c 100644 --- a/absl/container/internal/raw_hash_map.h +++ b/absl/container/internal/raw_hash_map.h @@ -19,6 +19,7 @@ #include #include +#include "absl/base/internal/throw_delegate.h" #include "absl/container/internal/container_memory.h" #include "absl/container/internal/raw_hash_set.h" // IWYU pragma: export @@ -136,14 +137,20 @@ class raw_hash_map : public raw_hash_set { template MappedReference

at(const key_arg& key) { auto it = this->find(key); - if (it == this->end()) std::abort(); + if (it == this->end()) { + base_internal::ThrowStdOutOfRange( + "absl::container_internal::raw_hash_map<>::at"); + } return Policy::value(&*it); } template MappedConstReference

at(const key_arg& key) const { auto it = this->find(key); - if (it == this->end()) std::abort(); + if (it == this->end()) { + base_internal::ThrowStdOutOfRange( + "absl::container_internal::raw_hash_map<>::at"); + } return Policy::value(&*it); } -- cgit v1.2.3