Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
base::NoDestructor< T > Class Template Reference

#include <no_destructor.h>

Public Member Functions

template<typename... Args>
 NoDestructor (Args &&... args)
 
 NoDestructor (const T &x)
 
 NoDestructor (T &&x)
 
 NoDestructor (const NoDestructor &)=delete
 
NoDestructoroperator= (const NoDestructor &)=delete
 
 ~NoDestructor ()=default
 
const Toperator* () const
 
Toperator* ()
 
const Toperator-> () const
 
Toperator-> ()
 
const Tget () const
 
Tget ()
 

Detailed Description

template<typename T>
class base::NoDestructor< T >

Definition at line 48 of file no_destructor.h.

Constructor & Destructor Documentation

◆ NoDestructor() [1/4]

template<typename T >
template<typename... Args>
base::NoDestructor< T >::NoDestructor ( Args &&...  args)
inlineexplicit

Definition at line 53 of file no_destructor.h.

53 {
54 new (storage_) T(std::forward<Args>(args)...);
55 }
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
#define T
Definition: precompiler.cc:65

◆ NoDestructor() [2/4]

template<typename T >
base::NoDestructor< T >::NoDestructor ( const T x)
inlineexplicit

Definition at line 59 of file no_destructor.h.

59{ new (storage_) T(x); }
double x

◆ NoDestructor() [3/4]

template<typename T >
base::NoDestructor< T >::NoDestructor ( T &&  x)
inlineexplicit

Definition at line 60 of file no_destructor.h.

60{ new (storage_) T(std::move(x)); }

◆ NoDestructor() [4/4]

template<typename T >
base::NoDestructor< T >::NoDestructor ( const NoDestructor< T > &  )
delete

◆ ~NoDestructor()

template<typename T >
base::NoDestructor< T >::~NoDestructor ( )
default

Member Function Documentation

◆ get() [1/2]

template<typename T >
T * base::NoDestructor< T >::get ( )
inline

Definition at line 74 of file no_destructor.h.

74{ return reinterpret_cast<T*>(storage_); }

◆ get() [2/2]

template<typename T >
const T * base::NoDestructor< T >::get ( ) const
inline

Definition at line 73 of file no_destructor.h.

73{ return reinterpret_cast<const T*>(storage_); }

◆ operator*() [1/2]

template<typename T >
T & base::NoDestructor< T >::operator* ( )
inline

Definition at line 68 of file no_destructor.h.

68{ return *get(); }
const T * get() const
Definition: no_destructor.h:73

◆ operator*() [2/2]

template<typename T >
const T & base::NoDestructor< T >::operator* ( ) const
inline

Definition at line 67 of file no_destructor.h.

67{ return *get(); }

◆ operator->() [1/2]

template<typename T >
T * base::NoDestructor< T >::operator-> ( )
inline

Definition at line 71 of file no_destructor.h.

71{ return get(); }

◆ operator->() [2/2]

template<typename T >
const T * base::NoDestructor< T >::operator-> ( ) const
inline

Definition at line 70 of file no_destructor.h.

70{ return get(); }

◆ operator=()

template<typename T >
NoDestructor & base::NoDestructor< T >::operator= ( const NoDestructor< T > &  )
delete

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