|
GMP 0.3.0
Generative Metaprogramming library for C++
|
Singleton specialization with dead-reference recovery support. More...
#include <singleton.hpp>
Static Public Member Functions | |
| template<typename... Args> | |
| static T & | instance (Args &&... args) |
| Get the singleton instance, recreating it if necessary. | |
Protected Member Functions | |
| singleton ()=default | |
| virtual | ~singleton () |
Static Protected Attributes | |
| static T * | pInstance_ |
| static bool | destroyed_ |
This specialization keeps explicit state about the singleton lifetime and can recreate the singleton if instance() is called after destruction.
| T | The derived singleton type. |
Definition at line 101 of file singleton.hpp.
|
protecteddefault |
|
inlineprotectedvirtual |
Definition at line 152 of file singleton.hpp.
|
inlinestatic |
| Args | Constructor argument types. |
| args | Constructor arguments used during creation or recreation. |
Definition at line 110 of file singleton.hpp.
References gmp::enum_values().