libjmmcg
release_579_6_g8cffd
A C++ library containing an eclectic mix of useful, advanced components.
|
A so-called "Meyers" singleton. More...
#include <singleton.hpp>
Public Types | |
typedef V | element_type |
The type of the object "managed". More... | |
typedef void | argument_type |
typedef argument_type | first_argument_type |
typedef element_type | result_type |
Static Public Member Functions | |
static element_type & | instance () noexcept(false) |
Obtain the unique instance of the object. More... | |
A so-called "Meyers" singleton.
Note that this implementation specifically leaks, and does not clean up, even at atexit(), any resource it allocates. Based upon the "Meyers Singleton" from [1], that reference gives full details of the undefined & implementation-defined "features" of this type of singleton.
[1] "Modern C++ Design" by A. Alexandrescu, Chapter 6 "Implementing Singletons", page 133
Definition at line 31 of file singleton.hpp.
typedef void jmmcg::LIBJMMCG_VER_NAMESPACE::singleton::leaked_meyers< V >::argument_type |
Definition at line 33 of file singleton.hpp.
typedef V jmmcg::LIBJMMCG_VER_NAMESPACE::singleton::leaked_meyers< V >::element_type |
The type of the object "managed".
Definition at line 32 of file singleton.hpp.
typedef argument_type jmmcg::LIBJMMCG_VER_NAMESPACE::singleton::leaked_meyers< V >::first_argument_type |
Definition at line 34 of file singleton.hpp.
typedef element_type jmmcg::LIBJMMCG_VER_NAMESPACE::singleton::leaked_meyers< V >::result_type |
Definition at line 35 of file singleton.hpp.
|
inlinestaticnoexcept |
Obtain the unique instance of the object.
Definition at line 41 of file singleton.hpp.