---
name: "std::enable_shared_from_this"
section: "3"
platform: "linux"
package: "gcc"
version: "16.2.1+r23+gd564253eb6c8-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/std::enable_shared_from_this"
---

# std::enable\_shared\_from\_this(3)

Base class allowing use of the member function shared\_from\_this.

## NAME

std::enable\_shared\_from\_this\< \_Tp \> - Base class allowing use of the member function shared\_from\_this.

## SYNOPSIS

\#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

## Author

Generated automatically by Doxygen for libstdc++ from the source code.
