diff --git a/absl/container/internal/btree_container.h b/absl/container/internal/btree_container.h index 21f00ae4..f4f41d0d 100644 --- a/absl/container/internal/btree_container.h +++ b/absl/container/internal/btree_container.h @@ -640,12 +640,12 @@ class btree_map_container : public btree_set_container { } template >()> mapped_type &operator[](key_arg &&k) ABSL_ATTRIBUTE_LIFETIME_BOUND { - return try_emplace(std::forward(k)).first->second; + return try_emplace(std::forward>(k)).first->second; } template > = 0> mapped_type &operator[](key_arg &&k ABSL_INTERNAL_ATTRIBUTE_CAPTURED_BY( this)) ABSL_ATTRIBUTE_LIFETIME_BOUND { - return this->template operator[](std::forward(k)); + return this->template operator[](std::forward>(k)); } template diff --git a/absl/container/internal/raw_hash_map.h b/absl/container/internal/raw_hash_map.h index b42a4f22..85adf879 100644 --- a/absl/container/internal/raw_hash_map.h +++ b/absl/container/internal/raw_hash_map.h @@ -205,7 +205,8 @@ class raw_hash_map : public raw_hash_set { !std::is_convertible::value, int>::type = 0> std::pair try_emplace(key_arg &&k, Args &&...args) ABSL_ATTRIBUTE_LIFETIME_BOUND { - return try_emplace_impl(std::forward(k), std::forward(args)...); + return try_emplace_impl(std::forward>(k), + std::forward(args)...); } template { std::pair try_emplace( key_arg &&k ABSL_INTERNAL_ATTRIBUTE_CAPTURED_BY(this), Args &&...args) ABSL_ATTRIBUTE_LIFETIME_BOUND { - return this->template try_emplace(std::forward(k), + return this->template try_emplace(std::forward>(k), std::forward(args)...); } @@ -241,14 +242,15 @@ class raw_hash_map : public raw_hash_set { class... Args> iterator try_emplace(const_iterator, key_arg &&k, Args &&...args) ABSL_ATTRIBUTE_LIFETIME_BOUND { - return try_emplace(std::forward(k), std::forward(args)...).first; + return try_emplace(std::forward>(k), std::forward(args)...) + .first; } template > = 0> iterator try_emplace(const_iterator hint, key_arg &&k ABSL_INTERNAL_ATTRIBUTE_CAPTURED_BY(this), Args &&...args) ABSL_ATTRIBUTE_LIFETIME_BOUND { - return this->template try_emplace(hint, std::forward(k), + return this->template try_emplace(hint, std::forward>(k), std::forward(args)...); } @@ -264,7 +266,7 @@ class raw_hash_map : public raw_hash_set { const key_arg &k ABSL_INTERNAL_ATTRIBUTE_CAPTURED_BY(this), Args &&...args) ABSL_ATTRIBUTE_LIFETIME_BOUND { - return this->template try_emplace(hint, std::forward(k), + return this->template try_emplace(hint, k, std::forward(args)...); } @@ -296,15 +298,15 @@ class raw_hash_map : public raw_hash_set { // It is safe to use unchecked_deref here because try_emplace // will always return an iterator pointing to a valid item in the table, // since it inserts if nothing is found for the given key. - return Policy::value( - &this->unchecked_deref(try_emplace(std::forward(key)).first)); + return Policy::value(&this->unchecked_deref( + try_emplace(std::forward>(key)).first)); } template > = 0> MappedReference

operator[]( key_arg &&key ABSL_INTERNAL_ATTRIBUTE_CAPTURED_BY(this)) ABSL_ATTRIBUTE_LIFETIME_BOUND { - return this->template operator[](std::forward(key)); + return this->template operator[](std::forward>(key)); } template