As an exercise, I wish to make a class that can't have more than N instances. How can I do that?

Suppose, for example, you want to limit number of connection to database so that no more than N users can connect at the same time. I understand how to make a singleton:

```
class Singleton {

private:

    Singleton(const Singleton&);

    Singleton();

public :

    static Singleton Instance() {

         static Singleton p;

         if(!p) {

                p = new Singleton;

         }
};

```

But if there N > 1 objects, I need help.