|
GMP 0.3.0
Generative Metaprogramming library for C++
|
Default singleton specialization using a function-local static object. More...
#include <singleton.hpp>
Static Public Member Functions | |
| template<typename... Args> | |
| static T & | instance (Args &&... args) |
| Get the singleton instance. | |
Protected Member Functions | |
| singleton ()=default | |
| virtual | ~singleton () |
This specialization is the usual zero-overhead singleton form. The first call to instance() constructs the object, and subsequent calls return the same instance for the lifetime of the program.
| T | The derived singleton type. |
Definition at line 65 of file singleton.hpp.
|
protecteddefault |
|
inlineprotectedvirtual |
Definition at line 84 of file singleton.hpp.
|
inlinestatic |
The first call constructs the object using the provided arguments. Later calls ignore constructor arguments and return the same instance.
| Args | Constructor argument types. |
| args | Constructor arguments used on first initialization. |
Definition at line 77 of file singleton.hpp.
References gmp::enum_values().