Skip to main content

Questions tagged [singleton]

The singleton is a design pattern to ensure that exactly one application-wide instance of a particular class exists.

4 votes
1 answer
224 views

I used to write singleton in Python, which actually Alpha only need to initialize once and the trading bot will run forever. For example in main.py: ...
tung's user avatar
  • 127
0 votes
1 answer
145 views

I am basically a beginner, so I Wrote some code that implements a zero cost singleton, through it will crash your program if you have a MMU. ...
Delfin's user avatar
  • 101
3 votes
1 answer
5k views

The Microsoft.Extensions method for Polly, to use policies via dependency injection, serviceCollection.AddPolicyRegistry() only allows to add already created ...
Erik Hart's user avatar
  • 311
5 votes
2 answers
544 views

I am creating a metaclass which ensures that instances of an actual class A are kind of singletons. But rather than having only single instance of ...
Tomáš Hons's user avatar
0 votes
1 answer
992 views

Is this a correct implementation of a generic Meyers Singleton in C++17? Any tips appreciated. Singleton.h ...
Tom Gebel's user avatar
  • 360
1 vote
2 answers
2k views

I recently was reading an article labeled "Modern C++ Singleton Template". The proposed solution used C++11 feature of Magic Statics (N2660). I wanted to adapt it for an own project in "...
Heinz's user avatar
  • 11
0 votes
1 answer
2k views

I wrote a Singleton template, with examples, google tests and README https://github.com/erez-strauss/init_singleton/blob/master/singleton.h The usage can be as simple as: ...
user5673656's user avatar
1 vote
0 answers
64 views

I've been trying to make a work-around for global usage; however, I can't seem to find an alternative. I'd like to create a C++ suffix function which converts pixels to millimeters. A custom gui ...
Michael Choi's user avatar

15 30 50 per page
1
2 3 4 5
12