×

Loading...

It can be used to limit the number of instances of a singleton class to be created. For example “your” singleton class can has only one instance, “my” singleton class can has a fixed number of instances.

class Singleton {
public:
/* Other public members will be added here */

private:
/* Other private members will be added here */
static Singleton obj[3];
};
Report