|
GMP 0.3.0
Generative Metaprogramming library for C++
|
CRTP-based singleton helper with optional dead-reference recovery. More...
Derive a type T from singleton<T> to obtain a process-wide instance() accessor. The default specialization uses a function-local static object and provides the simplest singleton lifetime model. The LongLifeTime = true specialization keeps additional state so it can recreate the singleton after destruction if instance() is accessed again.
| T | The derived singleton type. |
| LongLifeTime | When false, use a function-local static instance. When true, enable dead-reference handling and recreation support. |
Definition at line 54 of file singleton.hpp.