CppCommon  1.0.4.1
C++ Common Library
Classes | Static Public Attributes | List of all members
CppCommon::StaticConstructor< construct, destruct > Class Template Reference

Static constructor pattern. More...

#include <static_constructor.h>

Static Public Attributes

static constructor instance
 Static constructor instance. More...
 

Detailed Description

template<void(*)() construct, void(*)() destruct = nullptr>
class CppCommon::StaticConstructor< construct, destruct >

Static constructor pattern.

Static constructor pattern is used to emulate static constructor and destructor for C++ class.

Thread-safe.

Example:

class MyClass
{
private:
static void StaticConstructor()
{
...
}
static void StaticDestructor()
{
...
}
};
static constructor instance
Static constructor instance.

Definition at line 48 of file static_constructor.h.

Member Data Documentation

◆ instance

template<void(*)() construct, void(*)() destruct>
StaticConstructor< construct, destruct >::constructor CppCommon::StaticConstructor< construct, destruct >::instance
static

Static constructor instance.

Examples
utility_static_constructor.cpp.

Definition at line 54 of file static_constructor.h.


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