libstdc++: std::enable_shared_from_this< _Tp > Class Template Reference

libstdc++

std::enable_shared_from_this< _Tp > Class Template Reference
Utilities » Memory » Pointer Abstractions

`#include <memory>`

## Public Member Functions
shared_ptr< _Tp > | shared_from_this ()
shared_ptr< const _Tp > | shared_from_this () const

## Protected Member Functions
| enable_shared_from_this (const enable_shared_from_this &) noexcept
enable_shared_from_this & | operator= (const enable_shared_from_this &) noexcept

## Friends
const enable_shared_from_this * | __enable_shared_from_this_base (const __shared_count<> &, const enable_shared_from_this *__p)
template<typename, _Lock_policy>
class | __shared_ptr

## Detailed Description

template<typename _Tp>
class std::enable_shared_from_this< _Tp >

Base class allowing use of the member function shared_from_this.

Since
  C++11

Definition at line 958 of file bits/shared_ptr.h.

## Constructor & Destructor Documentation

## ◆ enable_shared_from_this() [1/2]

template<typename _Tp>

std::enable_shared_from_this< _Tp >::enable_shared_from_this | ( |  | ) |
| inlineconstexprprotectednoexcept

Definition at line 961 of file bits/shared_ptr.h.

## ◆ enable_shared_from_this() [2/2]

template<typename _Tp>

std::enable_shared_from_this< _Tp >::enable_shared_from_this | ( | const enable_shared_from_this< _Tp > & |  | ) |
| inlineprotectednoexcept

Definition at line 963 of file bits/shared_ptr.h.

## ◆ ~enable_shared_from_this()

template<typename _Tp>

std::enable_shared_from_this< _Tp >::~enable_shared_from_this | ( |  | ) |
| inlineprotected

Definition at line 969 of file bits/shared_ptr.h.

## Member Function Documentation

## ◆ operator=()

template<typename _Tp>

enable_shared_from_this & std::enable_shared_from_this< _Tp >::operator= | ( | const enable_shared_from_this< _Tp > & |  | ) |
| inlineprotectednoexcept

Definition at line 966 of file bits/shared_ptr.h.

## ◆ shared_from_this() [1/2]

template<typename _Tp>

shared_ptr< _Tp > std::enable_shared_from_this< _Tp >::shared_from_this | ( |  | ) |
| inline

Definition at line 973 of file bits/shared_ptr.h.

## ◆ shared_from_this() [2/2]

template<typename _Tp>

shared_ptr< const _Tp > std::enable_shared_from_this< _Tp >::shared_from_this | ( |  | ) | const
| inline

Definition at line 977 of file bits/shared_ptr.h.

## Friends And Related Symbol Documentation

## ◆ __enable_shared_from_this_base

template<typename _Tp>

const enable_shared_from_this * __enable_shared_from_this_base | ( | const __shared_count<> & | ,
|  | const enable_shared_from_this< _Tp > * | __p )
| friend

Definition at line 1003 of file bits/shared_ptr.h.

## ◆ __shared_ptr

template<typename _Tp>
template<typename, _Lock_policy>

friend class __shared_ptr
| friend

Definition at line 1008 of file bits/shared_ptr.h.

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

- bits/shared_ptr.h