I want to use the Object Pool design pattern for my library, so that the user cannot create more than a predefined number of objects.
How can I force the user to use the Pool class for acquiring an instance, instead of constructor of the resource?
I can't declare the resource constructor private because then the pool class won't be able to create the instance either...
Thanks