typedef _VSTD::reverse_iterator<const_iterator> const_reverse_iterator;
_LIBCPP_INLINE_VISIBILITY
- explicit map(const key_compare& __comp = key_compare())
+ map()
+ _NOEXCEPT_(
+ is_nothrow_default_constructible<allocator_type>::value &&
+ is_nothrow_default_constructible<key_compare>::value &&
+ is_nothrow_copy_constructible<key_compare>::value)
+ : __tree_(__vc(key_compare())) {}
+
+ _LIBCPP_INLINE_VISIBILITY
+ explicit map(const key_compare& __comp)
_NOEXCEPT_(
is_nothrow_default_constructible<allocator_type>::value &&
is_nothrow_default_constructible<key_compare>::value &&
#if __cplusplus >= 201103L
__tree_ = __m.__tree_;
#else
- __tree_.clear();
- __tree_.value_comp() = __m.__tree_.value_comp();
- __tree_.__copy_assign_alloc(__m.__tree_);
- insert(__m.begin(), __m.end());
+ if (this != &__m) {
+ __tree_.clear();
+ __tree_.value_comp() = __m.__tree_.value_comp();
+ __tree_.__copy_assign_alloc(__m.__tree_);
+ insert(__m.begin(), __m.end());
+ }
#endif
return *this;
}
typedef _VSTD::reverse_iterator<const_iterator> const_reverse_iterator;
_LIBCPP_INLINE_VISIBILITY
- explicit multimap(const key_compare& __comp = key_compare())
+ multimap()
+ _NOEXCEPT_(
+ is_nothrow_default_constructible<allocator_type>::value &&
+ is_nothrow_default_constructible<key_compare>::value &&
+ is_nothrow_copy_constructible<key_compare>::value)
+ : __tree_(__vc(key_compare())) {}
+
+ _LIBCPP_INLINE_VISIBILITY
+ explicit multimap(const key_compare& __comp)
_NOEXCEPT_(
is_nothrow_default_constructible<allocator_type>::value &&
is_nothrow_default_constructible<key_compare>::value &&
#if __cplusplus >= 201103L
__tree_ = __m.__tree_;
#else
- __tree_.clear();
- __tree_.value_comp() = __m.__tree_.value_comp();
- __tree_.__copy_assign_alloc(__m.__tree_);
- insert(__m.begin(), __m.end());
+ if (this != &__m) {
+ __tree_.clear();
+ __tree_.value_comp() = __m.__tree_.value_comp();
+ __tree_.__copy_assign_alloc(__m.__tree_);
+ insert(__m.begin(), __m.end());
+ }
#endif
return *this;
}