Chromium Embedded Framework (CEF)  114.2.1+gd70a0a8+chromium-114.0.5735.45
base::SupportsWeakPtr< T > Class Template Reference

A class may extend from SupportsWeakPtr to let others take weak pointers to it. More...

#include "include/base/cef_weak_ptr.h"

Inheritance diagram for base::SupportsWeakPtr< T >:
base::cef_internal::SupportsWeakPtrBase

Public Member Functions

 SupportsWeakPtr ()=default
 
 SupportsWeakPtr (const SupportsWeakPtr &)=delete
 
SupportsWeakPtroperator= (const SupportsWeakPtr &)=delete
 
WeakPtr< T > AsWeakPtr ()
 

Protected Member Functions

 ~SupportsWeakPtr ()=default
 

Additional Inherited Members

- Static Public Member Functions inherited from base::cef_internal::SupportsWeakPtrBase
template<typename Derived >
static WeakPtr< Derived > StaticAsWeakPtr (Derived *t)
 

Detailed Description

template<class T>
class base::SupportsWeakPtr< T >

A class may extend from SupportsWeakPtr to let others take weak pointers to it.

This avoids the class itself implementing boilerplate to dispense weak pointers. However, since SupportsWeakPtr's destructor won't invalidate weak pointers to the class until after the derived class' members have been destroyed, its use can lead to subtle use-after-destroy issues.

Constructor & Destructor Documentation

◆ SupportsWeakPtr() [1/2]

template<class T >
base::SupportsWeakPtr< T >::SupportsWeakPtr ( )
default

◆ SupportsWeakPtr() [2/2]

template<class T >
base::SupportsWeakPtr< T >::SupportsWeakPtr ( const SupportsWeakPtr< T > &  )
delete

◆ ~SupportsWeakPtr()

template<class T >
base::SupportsWeakPtr< T >::~SupportsWeakPtr ( )
protecteddefault

Member Function Documentation

◆ AsWeakPtr()

template<class T >
WeakPtr<T> base::SupportsWeakPtr< T >::AsWeakPtr ( )
inline

◆ operator=()

template<class T >
SupportsWeakPtr& base::SupportsWeakPtr< T >::operator= ( const SupportsWeakPtr< T > &  )
delete

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