@@ -1034,20 +1034,20 @@ public:
10341034 _LIBCPP_HIDE_FROM_ABI unordered_map& operator =(initializer_list<value_type> __il);
10351035# endif // _LIBCPP_CXX03_LANG
10361036
1037- _LIBCPP_HIDE_FROM_ABI allocator_type get_allocator () const _NOEXCEPT {
1037+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI allocator_type get_allocator () const _NOEXCEPT {
10381038 return allocator_type (__table_.__node_alloc ());
10391039 }
10401040
10411041 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool empty () const _NOEXCEPT { return __table_.size () == 0 ; }
1042- _LIBCPP_HIDE_FROM_ABI size_type size () const _NOEXCEPT { return __table_.size (); }
1043- _LIBCPP_HIDE_FROM_ABI size_type max_size () const _NOEXCEPT { return __table_.max_size (); }
1042+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type size () const _NOEXCEPT { return __table_.size (); }
1043+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type max_size () const _NOEXCEPT { return __table_.max_size (); }
10441044
1045- _LIBCPP_HIDE_FROM_ABI iterator begin () _NOEXCEPT { return __table_.begin (); }
1046- _LIBCPP_HIDE_FROM_ABI iterator end () _NOEXCEPT { return __table_.end (); }
1047- _LIBCPP_HIDE_FROM_ABI const_iterator begin () const _NOEXCEPT { return __table_.begin (); }
1048- _LIBCPP_HIDE_FROM_ABI const_iterator end () const _NOEXCEPT { return __table_.end (); }
1049- _LIBCPP_HIDE_FROM_ABI const_iterator cbegin () const _NOEXCEPT { return __table_.begin (); }
1050- _LIBCPP_HIDE_FROM_ABI const_iterator cend () const _NOEXCEPT { return __table_.end (); }
1045+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator begin () _NOEXCEPT { return __table_.begin (); }
1046+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator end () _NOEXCEPT { return __table_.end (); }
1047+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator begin () const _NOEXCEPT { return __table_.begin (); }
1048+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator end () const _NOEXCEPT { return __table_.end (); }
1049+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator cbegin () const _NOEXCEPT { return __table_.begin (); }
1050+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator cend () const _NOEXCEPT { return __table_.end (); }
10511051
10521052 _LIBCPP_HIDE_FROM_ABI pair<iterator, bool > insert (const value_type& __x) { return __table_.__emplace_unique (__x); }
10531053
@@ -1171,10 +1171,10 @@ public:
11711171 " node_type with incompatible allocator passed to unordered_map::insert()" );
11721172 return __table_.template __node_handle_insert_unique <node_type>(__hint.__i_ , std::move (__nh));
11731173 }
1174- _LIBCPP_HIDE_FROM_ABI node_type extract (key_type const & __key) {
1174+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI node_type extract (key_type const & __key) {
11751175 return __table_.template __node_handle_extract <node_type>(__key);
11761176 }
1177- _LIBCPP_HIDE_FROM_ABI node_type extract (const_iterator __it) {
1177+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI node_type extract (const_iterator __it) {
11781178 return __table_.template __node_handle_extract <node_type>(__it.__i_ );
11791179 }
11801180
@@ -1208,79 +1208,91 @@ public:
12081208 __table_.swap (__u.__table_ );
12091209 }
12101210
1211- _LIBCPP_HIDE_FROM_ABI hasher hash_function () const { return __table_.hash_function ().hash_function (); }
1212- _LIBCPP_HIDE_FROM_ABI key_equal key_eq () const { return __table_.key_eq ().key_eq (); }
1211+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI hasher hash_function () const {
1212+ return __table_.hash_function ().hash_function ();
1213+ }
1214+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI key_equal key_eq () const { return __table_.key_eq ().key_eq (); }
12131215
1214- _LIBCPP_HIDE_FROM_ABI iterator find (const key_type& __k) { return __table_.find (__k); }
1215- _LIBCPP_HIDE_FROM_ABI const_iterator find (const key_type& __k) const { return __table_.find (__k); }
1216+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator find (const key_type& __k) { return __table_.find (__k); }
1217+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator find (const key_type& __k) const { return __table_.find (__k); }
12161218# if _LIBCPP_STD_VER >= 20
12171219 template <class _K2 , enable_if_t <__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr >
1218- _LIBCPP_HIDE_FROM_ABI iterator find (const _K2& __k) {
1220+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI iterator find (const _K2& __k) {
12191221 return __table_.find (__k);
12201222 }
12211223 template <class _K2 , enable_if_t <__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr >
1222- _LIBCPP_HIDE_FROM_ABI const_iterator find (const _K2& __k) const {
1224+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI const_iterator find (const _K2& __k) const {
12231225 return __table_.find (__k);
12241226 }
12251227# endif // _LIBCPP_STD_VER >= 20
12261228
1227- _LIBCPP_HIDE_FROM_ABI size_type count (const key_type& __k) const { return __table_.__count_unique (__k); }
1229+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type count (const key_type& __k) const {
1230+ return __table_.__count_unique (__k);
1231+ }
12281232# if _LIBCPP_STD_VER >= 20
12291233 template <class _K2 , enable_if_t <__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr >
1230- _LIBCPP_HIDE_FROM_ABI size_type count (const _K2& __k) const {
1234+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI size_type count (const _K2& __k) const {
12311235 return __table_.__count_unique (__k);
12321236 }
12331237# endif // _LIBCPP_STD_VER >= 20
12341238
12351239# if _LIBCPP_STD_VER >= 20
1236- _LIBCPP_HIDE_FROM_ABI bool contains (const key_type& __k) const { return find (__k) != end (); }
1240+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool contains (const key_type& __k) const { return find (__k) != end (); }
12371241
12381242 template <class _K2 , enable_if_t <__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr >
1239- _LIBCPP_HIDE_FROM_ABI bool contains (const _K2& __k) const {
1243+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool contains (const _K2& __k) const {
12401244 return find (__k) != end ();
12411245 }
12421246# endif // _LIBCPP_STD_VER >= 20
12431247
1244- _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range (const key_type& __k) {
1248+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range (const key_type& __k) {
12451249 return __table_.__equal_range_unique (__k);
12461250 }
1247- _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range (const key_type& __k) const {
1251+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range (const key_type& __k) const {
12481252 return __table_.__equal_range_unique (__k);
12491253 }
12501254# if _LIBCPP_STD_VER >= 20
12511255 template <class _K2 , enable_if_t <__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr >
1252- _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range (const _K2& __k) {
1256+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range (const _K2& __k) {
12531257 return __table_.__equal_range_unique (__k);
12541258 }
12551259 template <class _K2 , enable_if_t <__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr >
1256- _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range (const _K2& __k) const {
1260+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range (const _K2& __k) const {
12571261 return __table_.__equal_range_unique (__k);
12581262 }
12591263# endif // _LIBCPP_STD_VER >= 20
12601264
1261- _LIBCPP_HIDE_FROM_ABI mapped_type& operator [](const key_type& __k);
1265+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI mapped_type& operator [](const key_type& __k);
12621266# ifndef _LIBCPP_CXX03_LANG
1263- _LIBCPP_HIDE_FROM_ABI mapped_type& operator [](key_type&& __k);
1267+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI mapped_type& operator [](key_type&& __k);
12641268# endif
12651269
1266- _LIBCPP_HIDE_FROM_ABI mapped_type& at (const key_type& __k);
1267- _LIBCPP_HIDE_FROM_ABI const mapped_type& at (const key_type& __k) const ;
1270+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI mapped_type& at (const key_type& __k);
1271+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const mapped_type& at (const key_type& __k) const ;
12681272
1269- _LIBCPP_HIDE_FROM_ABI size_type bucket_count () const _NOEXCEPT { return __table_.bucket_count (); }
1270- _LIBCPP_HIDE_FROM_ABI size_type max_bucket_count () const _NOEXCEPT { return __table_.max_bucket_count (); }
1273+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type bucket_count () const _NOEXCEPT { return __table_.bucket_count (); }
1274+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type max_bucket_count () const _NOEXCEPT {
1275+ return __table_.max_bucket_count ();
1276+ }
12711277
1272- _LIBCPP_HIDE_FROM_ABI size_type bucket_size (size_type __n) const { return __table_.bucket_size (__n); }
1273- _LIBCPP_HIDE_FROM_ABI size_type bucket (const key_type& __k) const { return __table_.bucket (__k); }
1278+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type bucket_size (size_type __n) const {
1279+ return __table_.bucket_size (__n);
1280+ }
1281+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type bucket (const key_type& __k) const { return __table_.bucket (__k); }
12741282
1275- _LIBCPP_HIDE_FROM_ABI local_iterator begin (size_type __n) { return __table_.begin (__n); }
1276- _LIBCPP_HIDE_FROM_ABI local_iterator end (size_type __n) { return __table_.end (__n); }
1277- _LIBCPP_HIDE_FROM_ABI const_local_iterator begin (size_type __n) const { return __table_.cbegin (__n); }
1278- _LIBCPP_HIDE_FROM_ABI const_local_iterator end (size_type __n) const { return __table_.cend (__n); }
1279- _LIBCPP_HIDE_FROM_ABI const_local_iterator cbegin (size_type __n) const { return __table_.cbegin (__n); }
1280- _LIBCPP_HIDE_FROM_ABI const_local_iterator cend (size_type __n) const { return __table_.cend (__n); }
1283+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI local_iterator begin (size_type __n) { return __table_.begin (__n); }
1284+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI local_iterator end (size_type __n) { return __table_.end (__n); }
1285+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_local_iterator begin (size_type __n) const {
1286+ return __table_.cbegin (__n);
1287+ }
1288+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_local_iterator end (size_type __n) const { return __table_.cend (__n); }
1289+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_local_iterator cbegin (size_type __n) const {
1290+ return __table_.cbegin (__n);
1291+ }
1292+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_local_iterator cend (size_type __n) const { return __table_.cend (__n); }
12811293
1282- _LIBCPP_HIDE_FROM_ABI float load_factor () const _NOEXCEPT { return __table_.load_factor (); }
1283- _LIBCPP_HIDE_FROM_ABI float max_load_factor () const _NOEXCEPT { return __table_.max_load_factor (); }
1294+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI float load_factor () const _NOEXCEPT { return __table_.load_factor (); }
1295+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI float max_load_factor () const _NOEXCEPT { return __table_.max_load_factor (); }
12841296 _LIBCPP_HIDE_FROM_ABI void max_load_factor (float __mlf) { __table_.max_load_factor (__mlf); }
12851297 _LIBCPP_HIDE_FROM_ABI void rehash (size_type __n) { __table_.__rehash_unique (__n); }
12861298 _LIBCPP_HIDE_FROM_ABI void reserve (size_type __n) { __table_.__reserve_unique (__n); }
0 commit comments