mirror of git://gcc.gnu.org/git/gcc.git
* include/bits/allocated_ptr.h (__allocated_ptr): Use __addressof.
From-SVN: r224540
This commit is contained in:
parent
200fcd3398
commit
91b142ffc3
|
|
@ -1,5 +1,7 @@
|
|||
2015-06-16 Jonathan Wakely <jwakely@redhat.com>
|
||||
|
||||
* include/bits/allocated_ptr.h (__allocated_ptr): Use __addressof.
|
||||
|
||||
* include/bits/list.tcc (list::operator=(const list&), list::merge):
|
||||
Use __addressof instead of operator&.
|
||||
(list::sort): Use array-to-pointer decay instead of operator&.
|
||||
|
|
|
|||
|
|
@ -50,14 +50,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
|||
|
||||
/// Take ownership of __ptr
|
||||
__allocated_ptr(_Alloc& __a, pointer __ptr) noexcept
|
||||
: _M_alloc(&__a), _M_ptr(__ptr)
|
||||
: _M_alloc(std::__addressof(__a)), _M_ptr(__ptr)
|
||||
{ }
|
||||
|
||||
/// Convert __ptr to allocator's pointer type and take ownership of it
|
||||
template<typename _Ptr,
|
||||
typename _Req = _Require<is_same<_Ptr, value_type*>>>
|
||||
__allocated_ptr(_Alloc& __a, _Ptr __ptr)
|
||||
: _M_alloc(&__a), _M_ptr(pointer_traits<pointer>::pointer_to(*__ptr))
|
||||
: _M_alloc(std::__addressof(__a)),
|
||||
_M_ptr(pointer_traits<pointer>::pointer_to(*__ptr))
|
||||
{ }
|
||||
|
||||
/// Transfer ownership of the owned pointer
|
||||
|
|
|
|||
Loading…
Reference in New Issue