# Pointer Abstractions
[Memory]

Collaboration diagram for Pointer Abstractions:

## Classes

- struct std::default_delete< _Tp >
    Primary template, default_delete. More...
- struct std::default_delete< _Tp[]>
    Specialization, default_delete. More...
- class std::enable_shared_from_this< _Tp >
    Base class allowing use of member function shared_from_this. More...
- struct std::owner_less< shared_ptr< _Tp > >
    Partial specialization of owner_less for shared_ptr. More...
- struct std::owner_less< weak_ptr< _Tp > >
    Partial specialization of owner_less for weak_ptr. More...
- class std::shared_ptr< _Tp >
    A smart pointer with reference-counted copy semantics. More...
- class std::unique_ptr< _Tp, _Tp_Deleter >
    20.7.12.2 unique_ptr for single objects. More...
- class std::unique_ptr< _Tp[], _Tp_Deleter >
    20.7.12.3 unique_ptr for array objects with a runtime length More...
- class std::weak_ptr< _Tp >
    A smart pointer with weak semantics. More...

## Functions

- template<typename _Tp , typename _Alloc , typename... _Args> shared_ptr< _Tp > std::allocate_shared (_Alloc __a, _Args &&...__args)
- template<typename _Tp , typename _Tp1 > shared_ptr< _Tp > std::const_pointer_cast (const shared_ptr< _Tp1 > &__r)
- template<typename _Tp , typename _Tp1 > shared_ptr< _Tp > std::dynamic_pointer_cast (const shared_ptr< _Tp1 > &__r)
- template<typename _Del , typename _Tp , _Lock_policy _Lp> _Del * std::get_deleter (const __shared_ptr< _Tp, _Lp > &__p)
- template<typename _Tp , typename... _Args> shared_ptr< _Tp > std::make_shared (_Args &&...__args)
- template<typename _Tp1 , typename _Tp2 > bool std::operator!= (const shared_ptr< _Tp1 > &__a, const shared_ptr< _Tp2 > &__b)
- template<typename _Tp , typename _Tp_Deleter , typename _Up , typename _Up_Deleter > bool std::operator!= (const unique_ptr< _Tp, _Tp_Deleter > &__x, const unique_ptr< _Up, _Up_Deleter > &__y)
- template<typename _Tp , typename _Tp_Deleter , typename _Up , typename _Up_Deleter > bool std::operator< (const unique_ptr< _Tp, _Tp_Deleter > &__x, const unique_ptr< _Up, _Up_Deleter > &__y)
- template<typename _Tp1 , typename _Tp2 > bool std::operator< (const shared_ptr< _Tp1 > &__a, const shared_ptr< _Tp2 > &__b)
- template<typename _Ch , typename _Tr , typename _Tp , _Lock_policy _Lp> std::basic_ostream< _Ch, _Tr > & std::operator<< (std::basic_ostream< _Ch, _Tr > &__os, const __shared_ptr< _Tp, _Lp > &__p)
- template<typename _Tp , typename _Tp_Deleter , typename _Up , typename _Up_Deleter > bool std::operator<= (const unique_ptr< _Tp, _Tp_Deleter > &__x, const unique_ptr< _Up, _Up_Deleter > &__y)
- template<typename _Tp , typename _Tp_Deleter , typename _Up , typename _Up_Deleter > bool std::operator== (const unique_ptr< _Tp, _Tp_Deleter > &__x, const unique_ptr< _Up, _Up_Deleter > &__y)
- template<typename _Tp1 , typename _Tp2 > bool std::operator== (const shared_ptr< _Tp1 > &__a, const shared_ptr< _Tp2 > &__b)
- template<typename _Tp , typename _Tp_Deleter , typename _Up , typename _Up_Deleter > bool std::operator> (const unique_ptr< _Tp, _Tp_Deleter > &__x, const unique_ptr< _Up, _Up_Deleter > &__y)
- template<typename _Tp , typename _Tp_Deleter , typename _Up , typename _Up_Deleter > bool std::operator>= (const unique_ptr< _Tp, _Tp_Deleter > &__x, const unique_ptr< _Up, _Up_Deleter > &__y)
- template<typename _Tp , typename _Tp1 > shared_ptr< _Tp > std::static_pointer_cast (const shared_ptr< _Tp1 > &__r)
- template<typename _Tp , typename _Tp_Deleter > void std::swap (unique_ptr< _Tp, _Tp_Deleter > &__x, unique_ptr< _Tp, _Tp_Deleter > &__y)
- template<typename _Tp > void std::swap (shared_ptr< _Tp > &__a, shared_ptr< _Tp > &__b)
- template<typename _Tp > void std::swap (weak_ptr< _Tp > &__a, weak_ptr< _Tp > &__b)

## Detailed Description

Smart pointers, etc.

## Function Documentation

template<typename _Tp , typename _Alloc , typename... _Args>

shared_ptr<_Tp> std::allocate_shared | ( | _Alloc | __a,
|  | _Args &&... | __args |
| ) |  |  | `[inline]`

Create an object that is owned by a shared_ptr.

Parameters:

  | __a | An allocator.
  | __args | Arguments for the _Tp object's constructor.

Returns:
  A shared_ptr that owns the newly created object.

Exceptions:

  | An | exception thrown from _Alloc::allocate or from the constructor of _Tp.

A copy of __a will be used to allocate memory for the shared_ptr and the new object.

Definition at line 452 of file shared_ptr.h.

template<typename _Del , typename _Tp , _Lock_policy _Lp>

_Del* std::get_deleter | ( | const __shared_ptr< _Tp, _Lp > & | __p | ) | `[inline]`

2.2.3.10 shared_ptr get_deleter (experimental)

Definition at line 74 of file shared_ptr.h.

template<typename _Tp , typename... _Args>

shared_ptr<_Tp> std::make_shared | ( | _Args &&... | __args | ) | `[inline]`

Create an object that is owned by a shared_ptr.

Parameters:

  | __args | Arguments for the _Tp object's constructor.

Returns:
  A shared_ptr that owns the newly created object.

Exceptions:

  | std::bad_alloc,or | an exception thrown from the constructor of _Tp.

Definition at line 467 of file shared_ptr.h.

template<typename _Ch , typename _Tr , typename _Tp , _Lock_policy _Lp>

std::basic_ostream<_Ch, _Tr>& std::operator<< | ( | std::basic_ostream< _Ch, _Tr > & | __os,
|  | const __shared_ptr< _Tp, _Lp > & | __p |
| ) |  |  | `[inline]`

2.2.3.7 shared_ptr I/O

Definition at line 64 of file shared_ptr.h.