[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

xhawk18/singleton-cpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cpp singleton that works across dll/exe boundaries.

Features --

  1. Share the same singleton instance in dynamical library and executable.
  2. Multithread safe
  3. Lazy construction
  4. Lock-free with double checked mutex on initialization.

Usage

  1. define a class or struct, for example
class MyObject {
public:
    int a;
    int b;
};
  1. use the singleton instance
#include "singleton-cpp/singleton.h"

MyObject &obj = singleton<MyObject>();

About

cpp singleton works across dll/exe boundaries.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published