30#ifndef _ALLOCATED_PTR_H
31#define _ALLOCATED_PTR_H 1
33#if __cplusplus < 201103L
34# include <bits/c++0xwarning.h>
40namespace std _GLIBCXX_VISIBILITY(default)
42_GLIBCXX_BEGIN_NAMESPACE_VERSION
45 template<
typename _Alloc>
57 template<
typename _Ptr,
66 : _M_alloc(
__gd._M_alloc), _M_ptr(
__gd._M_ptr)
67 {
__gd._M_ptr =
nullptr; }
72 if (_M_ptr !=
nullptr)
85 value_type*
get() {
return _S_raw_ptr(_M_ptr); }
88 value_type* _S_raw_ptr(value_type*
__ptr) {
return __ptr; }
90 template<
typename _Ptr>
91 auto _S_raw_ptr(_Ptr __ptr) ->
decltype(_S_raw_ptr(__ptr.operator->()))
92 {
return _S_raw_ptr(__ptr.operator->()); }
99 template<
typename _Alloc>
100 __allocated_ptr<_Alloc>
106_GLIBCXX_END_NAMESPACE_VERSION
_Tp * __addressof(_Tp &__r) noexcept
Same as C++11 std::addressof.
ISO C++ entities toplevel namespace is std.
__allocated_ptr< _Alloc > __allocate_guarded(_Alloc &__a)
Allocate space for a single object using __a.
static pointer allocate(_Alloc &__a, size_type __n)
Allocate memory.
_Alloc::value_type value_type
The allocated type.
static void deallocate(_Alloc &__a, pointer __p, size_type __n)
Deallocate memory.
Non-standard RAII type for managing pointers obtained from allocators.
__allocated_ptr(__allocated_ptr &&__gd) noexcept
Transfer ownership of the owned pointer.
__allocated_ptr(_Alloc &__a, _Ptr __ptr)
Convert __ptr to allocator's pointer type and take ownership of it.
__allocated_ptr & operator=(std::nullptr_t) noexcept
Release ownership of the owned pointer.
__allocated_ptr(_Alloc &__a, pointer __ptr) noexcept
Take ownership of __ptr.
~__allocated_ptr()
Deallocate the owned pointer.
value_type * get()
Get the address that the owned pointer refers to.
Uniform interface to all pointer-like types.