Fixed <rdar://problem/9969674>
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/branches/apple@137860 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
84fd172cd6
commit
3006f595eb
@ -1577,6 +1577,27 @@ private:
|
|||||||
_NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value);
|
_NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
|
void
|
||||||
|
__move_assign_alloc(const basic_string& __str)
|
||||||
|
_NOEXCEPT_(
|
||||||
|
!__alloc_traits::propagate_on_container_move_assignment::value ||
|
||||||
|
is_nothrow_move_assignable<allocator_type>::value)
|
||||||
|
{__move_assign_alloc(__str, integral_constant<bool,
|
||||||
|
__alloc_traits::propagate_on_container_move_assignment::value>());}
|
||||||
|
|
||||||
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
|
void __move_assign_alloc(const basic_string& __c, true_type)
|
||||||
|
_NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value)
|
||||||
|
{
|
||||||
|
__alloc() = _VSTD::move(__c.__alloc());
|
||||||
|
}
|
||||||
|
|
||||||
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
|
void __move_assign_alloc(const basic_string& __c, false_type)
|
||||||
|
_NOEXCEPT
|
||||||
|
{}
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
static void __swap_alloc(allocator_type& __x, allocator_type& __y)
|
static void __swap_alloc(allocator_type& __x, allocator_type& __y)
|
||||||
_NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value ||
|
_NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value ||
|
||||||
@ -2120,7 +2141,8 @@ basic_string<_CharT, _Traits, _Allocator>::__move_assign(basic_string& __str, tr
|
|||||||
{
|
{
|
||||||
clear();
|
clear();
|
||||||
shrink_to_fit();
|
shrink_to_fit();
|
||||||
__r_ = _VSTD::move(__str.__r_);
|
__r_.first() = __str.__r_.first();
|
||||||
|
__move_assign_alloc(__str);
|
||||||
__str.__zero();
|
__str.__zero();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user