libstdc++
std::unique_ptr< _Tp[], _Dp > Class Template Reference

List of all members.

Public Member Functions

template<typename _Del = _Dp, typename = _DeleterConstraint<_Del>>
constexpr unique_ptr () noexcept
template<typename _Up , typename _Vp = _Dp, typename = _DeleterConstraint<_Vp>, typename = typename enable_if< __safe_conversion_raw<_Up>::value, bool>::type>
 unique_ptr (_Up __p) noexcept
template<typename _Up , typename _Del = deleter_type, typename = _Require<__safe_conversion_raw<_Up>, is_copy_constructible<_Del>>>
 unique_ptr (_Up __p, const deleter_type &__d) noexcept
template<typename _Up , typename _Del = deleter_type, typename = _Require<__safe_conversion_raw<_Up>, is_move_constructible<_Del>>>
 unique_ptr (_Up __p, __enable_if_t<!is_lvalue_reference< _Del >::value, _Del && > __d) noexcept
template<typename _Up , typename _Del = deleter_type, typename _DelUnref = typename remove_reference<_Del>::type, typename = _Require<__safe_conversion_raw<_Up>>>
 unique_ptr (_Up, __enable_if_t< is_lvalue_reference< _Del >::value, _DelUnref && >)
 unique_ptr (unique_ptr &&__u) noexcept
template<typename _Del = _Dp, typename = _DeleterConstraint<_Del>>
constexpr unique_ptr (nullptr_t) noexcept
template<typename _Up , typename _Ep , typename = _Require<__safe_conversion_up<_Up, _Ep>>>
 unique_ptr (unique_ptr< _Up, _Ep > &&__u) noexcept
 unique_ptr (const unique_ptr &)
 ~unique_ptr ()
pointer get () const noexcept
deleter_type & get_deleter () noexcept
const deleter_type & get_deleter () const noexcept
 operator bool () const noexcept
unique_ptroperator= (unique_ptr &&__u) noexcept
template<typename _Up , typename _Ep >
enable_if< __and_
< __safe_conversion_up< _Up,
_Ep >, is_assignable
< deleter_type &, _Ep && >
>::value, unique_ptr & >
::type 
operator= (unique_ptr< _Up, _Ep > &&__u) noexcept
unique_ptroperator= (nullptr_t) noexcept
unique_ptroperator= (const unique_ptr &)
std::add_lvalue_reference
< element_type >::type 
operator[] (size_t __i) const
pointer release () noexcept
template<typename _Up , typename = _Require< __or_<is_same<_Up, pointer>, __and_<is_same<pointer, element_type*>, is_pointer<_Up>, is_convertible< typename remove_pointer<_Up>::type(*)[], element_type(*)[] > > > >>
void reset (_Up __p) noexcept
void reset (nullptr_t=nullptr) noexcept
void swap (unique_ptr &__u) noexcept

Detailed Description

template<typename _Tp, typename _Dp>
class std::unique_ptr< _Tp[], _Dp >

20.7.1.3 unique_ptr for array objects with a runtime length

Definition at line 420 of file unique_ptr.h.


Constructor & Destructor Documentation

template<typename _Tp , typename _Dp >
template<typename _Del = _Dp, typename = _DeleterConstraint<_Del>>
constexpr std::unique_ptr< _Tp[], _Dp >::unique_ptr ( ) [inline]

Default constructor, creates a unique_ptr that owns nothing.

Definition at line 475 of file unique_ptr.h.

template<typename _Tp , typename _Dp >
template<typename _Up , typename _Vp = _Dp, typename = _DeleterConstraint<_Vp>, typename = typename enable_if< __safe_conversion_raw<_Up>::value, bool>::type>
std::unique_ptr< _Tp[], _Dp >::unique_ptr ( _Up  __p) [inline, explicit]

Takes ownership of a pointer.

Parameters:
__pA pointer to an array of a type safely convertible to an array of element_type

The deleter will be value-initialized.

Definition at line 492 of file unique_ptr.h.

template<typename _Tp , typename _Dp >
template<typename _Up , typename _Del = deleter_type, typename = _Require<__safe_conversion_raw<_Up>, is_copy_constructible<_Del>>>
std::unique_ptr< _Tp[], _Dp >::unique_ptr ( _Up  __p,
const deleter_type &  __d 
) [inline]

Takes ownership of a pointer.

Parameters:
__pA pointer to an array of a type safely convertible to an array of element_type
__dA reference to a deleter.

The deleter will be initialized with __d

Definition at line 507 of file unique_ptr.h.

template<typename _Tp , typename _Dp >
template<typename _Up , typename _Del = deleter_type, typename = _Require<__safe_conversion_raw<_Up>, is_move_constructible<_Del>>>
std::unique_ptr< _Tp[], _Dp >::unique_ptr ( _Up  __p,
__enable_if_t<!is_lvalue_reference< _Del >::value, _Del && >  __d 
) [inline]

Takes ownership of a pointer.

Parameters:
__pA pointer to an array of a type safely convertible to an array of element_type
__dA reference to a deleter.

The deleter will be initialized with std::move(__d)

Definition at line 521 of file unique_ptr.h.

template<typename _Tp , typename _Dp >
std::unique_ptr< _Tp[], _Dp >::unique_ptr ( unique_ptr< _Tp[], _Dp > &&  __u) [inline]

Move constructor.

Definition at line 535 of file unique_ptr.h.

template<typename _Tp , typename _Dp >
template<typename _Del = _Dp, typename = _DeleterConstraint<_Del>>
constexpr std::unique_ptr< _Tp[], _Dp >::unique_ptr ( nullptr_t  ) [inline]

Creates a unique_ptr that owns nothing.

Definition at line 540 of file unique_ptr.h.

template<typename _Tp , typename _Dp >
std::unique_ptr< _Tp[], _Dp >::~unique_ptr ( ) [inline]

Destructor, invokes the deleter if the stored pointer is not null.

Definition at line 551 of file unique_ptr.h.

References std::unique_ptr< _Tp, _Dp >::get_deleter().


Member Function Documentation

template<typename _Tp , typename _Dp >
pointer std::unique_ptr< _Tp[], _Dp >::get ( void  ) const [inline]

Return the stored pointer.

Definition at line 615 of file unique_ptr.h.

template<typename _Tp , typename _Dp >
deleter_type& std::unique_ptr< _Tp[], _Dp >::get_deleter ( ) [inline]

Return a reference to the stored deleter.

Definition at line 620 of file unique_ptr.h.

template<typename _Tp , typename _Dp >
const deleter_type& std::unique_ptr< _Tp[], _Dp >::get_deleter ( ) const [inline]

Return a reference to the stored deleter.

Definition at line 625 of file unique_ptr.h.

template<typename _Tp , typename _Dp >
std::unique_ptr< _Tp[], _Dp >::operator bool ( ) const [inline, explicit]

Return true if the stored pointer is not null.

Definition at line 629 of file unique_ptr.h.

template<typename _Tp , typename _Dp >
unique_ptr& std::unique_ptr< _Tp[], _Dp >::operator= ( unique_ptr< _Tp[], _Dp > &&  __u) [inline]

Move assignment operator.

Parameters:
__uThe object to transfer ownership from.

Invokes the deleter first if this object owns a pointer.

Definition at line 568 of file unique_ptr.h.

References std::unique_ptr< _Tp, _Dp >::get_deleter(), and std::unique_ptr< _Tp, _Dp >::reset().

template<typename _Tp , typename _Dp >
template<typename _Up , typename _Ep >
enable_if<__and_<__safe_conversion_up<_Up, _Ep>, is_assignable<deleter_type&, _Ep&&> >::value, unique_ptr&>::type std::unique_ptr< _Tp[], _Dp >::operator= ( unique_ptr< _Up, _Ep > &&  __u) [inline]

Assignment from another type.

Parameters:
__uThe object to transfer ownership from, which owns a convertible pointer to an array object.

Invokes the deleter first if this object owns a pointer.

Definition at line 588 of file unique_ptr.h.

References std::unique_ptr< _Tp, _Dp >::get_deleter(), and std::unique_ptr< _Tp, _Dp >::reset().

template<typename _Tp , typename _Dp >
unique_ptr& std::unique_ptr< _Tp[], _Dp >::operator= ( nullptr_t  ) [inline]

Reset the unique_ptr to empty, invoking the deleter if necessary.

Definition at line 597 of file unique_ptr.h.

References std::unique_ptr< _Tp, _Dp >::reset().

template<typename _Tp , typename _Dp >
std::add_lvalue_reference<element_type>::type std::unique_ptr< _Tp[], _Dp >::operator[] ( size_t  __i) const [inline]

Access an element of owned array.

Definition at line 607 of file unique_ptr.h.

template<typename _Tp , typename _Dp >
pointer std::unique_ptr< _Tp[], _Dp >::release ( ) [inline]

Release ownership of any stored pointer.

Definition at line 636 of file unique_ptr.h.

template<typename _Tp , typename _Dp >
template<typename _Up , typename = _Require< __or_<is_same<_Up, pointer>, __and_<is_same<pointer, element_type*>, is_pointer<_Up>, is_convertible< typename remove_pointer<_Up>::type(*)[], element_type(*)[] > > > >>
void std::unique_ptr< _Tp[], _Dp >::reset ( _Up  __p) [inline]

Replace the stored pointer.

Parameters:
__pThe new pointer to store.

The deleter will be invoked if a pointer is already owned.

Definition at line 662 of file unique_ptr.h.

References std::unique_ptr< _Tp, _Dp >::get_deleter(), and std::unique_ptr< _Tp, _Dp >::swap().

template<typename _Tp , typename _Dp >
void std::unique_ptr< _Tp[], _Dp >::swap ( unique_ptr< _Tp[], _Dp > &  __u) [inline]

Exchange the pointer and deleter with another object.

Definition at line 678 of file unique_ptr.h.

References std::unique_ptr< _Tp, _Dp >::swap().


The documentation for this class was generated from the following file: