Anklang 0.3.0-460-gc4ef46ba
ASE — Anklang Sound Engine (C++)

« « « Anklang Documentation
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Ase::Persistent< Class > Class Template Referencefinal

#include "cxxaux.hh"

Public Member Functions

constexpr Persistent () noexcept
 A constexpr constructor avoids the static initialization order fiasco.
 
 operator bool () const __attribute__((__pure__))
 Check if this stores a Class instance yet.
 
Class & operator* () __attribute__((__pure__))
 Retrieve reference to Class instance, always returns the same reference.
 
Class * operator-> () __attribute__((__pure__))
 Retrieve pointer to Class instance, always returns the same pointer.
 

Detailed Description

template<class Class>
class Ase::Persistent< Class >

Create an instance of Class on demand that is constructed and never destructed. Due to its constexpr ctor and on-demand creation of Class, a Persistent<> can be accessed at any time during the static ctor (or dtor) phases and will always yield a properly initialized Class.

Definition at line 374 of file cxxaux.hh.

Constructor & Destructor Documentation

◆ Persistent()

template<class Class >
constexpr Ase::Persistent< Class >::Persistent ( )
constexprnoexcept

A constexpr constructor avoids the static initialization order fiasco.

Definition at line 388 of file cxxaux.hh.

Member Function Documentation

◆ operator bool()

template<class Class >
Ase::Persistent< Class >::operator bool ( ) const
explicit

Check if this stores a Class instance yet.

Definition at line 390 of file cxxaux.hh.

◆ operator*()

template<class Class >
Class & Ase::Persistent< Class >::operator* ( )

Retrieve reference to Class instance, always returns the same reference.

Definition at line 392 of file cxxaux.hh.

References Ase::Persistent< Class >::operator->().

◆ operator->()

template<class Class >
Class * Ase::Persistent< Class >::operator-> ( )

Retrieve pointer to Class instance, always returns the same pointer.

Definition at line 394 of file cxxaux.hh.

References ASE_UNLIKELY.

Referenced by Ase::Persistent< Class >::operator*().


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