doubleton pattern in C++
- by benjamin button
I am aware of the singleton pattern in C++.
but what is the logic to get two instances of the object?
is there any such pattern where we could easily get 2 pattern.
for the logic i could think of is that i can change the singleton pattern itself to have two objects created inside the class.this works. but if the requirement grows like if i need only 3 or only 4 what is the deswign pattern that i could think of to qualify such requirement?