summaryrefslogtreecommitdiffstats
path: root/contrib/libc++/include/unordered_map
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/libc++/include/unordered_map')
-rw-r--r--contrib/libc++/include/unordered_map28
1 files changed, 16 insertions, 12 deletions
diff --git a/contrib/libc++/include/unordered_map b/contrib/libc++/include/unordered_map
index 78fee48..4e2298b 100644
--- a/contrib/libc++/include/unordered_map
+++ b/contrib/libc++/include/unordered_map
@@ -831,12 +831,14 @@ public:
#if __cplusplus >= 201103L
__table_ = __u.__table_;
#else
- __table_.clear();
- __table_.hash_function() = __u.__table_.hash_function();
- __table_.key_eq() = __u.__table_.key_eq();
- __table_.max_load_factor() = __u.__table_.max_load_factor();
- __table_.__copy_assign_alloc(__u.__table_);
- insert(__u.begin(), __u.end());
+ if (this != &__u) {
+ __table_.clear();
+ __table_.hash_function() = __u.__table_.hash_function();
+ __table_.key_eq() = __u.__table_.key_eq();
+ __table_.max_load_factor() = __u.__table_.max_load_factor();
+ __table_.__copy_assign_alloc(__u.__table_);
+ insert(__u.begin(), __u.end());
+ }
#endif
return *this;
}
@@ -1567,12 +1569,14 @@ public:
#if __cplusplus >= 201103L
__table_ = __u.__table_;
#else
- __table_.clear();
- __table_.hash_function() = __u.__table_.hash_function();
- __table_.key_eq() = __u.__table_.key_eq();
- __table_.max_load_factor() = __u.__table_.max_load_factor();
- __table_.__copy_assign_alloc(__u.__table_);
- insert(__u.begin(), __u.end());
+ if (this != &__u) {
+ __table_.clear();
+ __table_.hash_function() = __u.__table_.hash_function();
+ __table_.key_eq() = __u.__table_.key_eq();
+ __table_.max_load_factor() = __u.__table_.max_load_factor();
+ __table_.__copy_assign_alloc(__u.__table_);
+ insert(__u.begin(), __u.end());
+ }
#endif
return *this;
}
OpenPOWER on IntegriCloud