RhythmGame 1.4.3
Loading...
Searching...
No Matches
Protected Member Functions | List of all members
support::EnableSharedFromBase< Base > Class Template Reference

A helper class for creating a shared pointer to self. More...

#include <EnableSharedFromBase.h>

Inheritance diagram for support::EnableSharedFromBase< Base >:
Inheritance graph
[legend]
Collaboration diagram for support::EnableSharedFromBase< Base >:
Collaboration graph
[legend]

Protected Member Functions

template<class Derived >
auto sharedFromBase () -> std::shared_ptr< Derived >
 

Detailed Description

template<class Base>
class support::EnableSharedFromBase< Base >

A helper class for creating a shared pointer to self.

Template Parameters
TThe type of the base class that inherits from this class (CRTP) The classic std::enable_shared_from_this<T> can be used to create a shared_ptr to self. However, derived classes would need to cast that shared_ptr to their own type to use it. This class wraps that casting.

Member Function Documentation

◆ sharedFromBase()

template<class Base >
template<class Derived >
auto support::EnableSharedFromBase< Base >::sharedFromBase ( ) -> std::shared_ptr<Derived>
inlineprotected

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