What Nemo Persona says, constantly newing and deleting objects is a bad idea if your game should be running for a longer period of time. Each new usually translates into a context switch from application/user mode into kernel mode for the OS, which then needs to allocate the requested amount of memory, and then switch back to user mode, which might take a long time depending on fragmentation and platform specifics.
ObjectPools are usually used to avoid new and delete for most of your use cases. You allocate a large memory buffer (either with new or malloc), and then manually hand out that memory to the rest of your application. That way you limit yourself to a low number of memory allocations, and instead only care about memory initialization (with placement new, for example).
The simplest way to make an ObjectPool is to use a vector for your planned type (i.e. std::vector<Ogre>), make a simple wrapper class that tracks which indices were "allocated" (more like requested to be used), and that's it. If you know for sure you will never need more than X amound of your objects, you can even just use an array (Ogre), and keep the same wrapper interface, without the user of that interface being none the wiser, except the fact that it won't be able to allocate more than 1000 Ogres.
Thanks, good answer.
More or less this is the way I was explaining. The problem with a single vector is reallocation handling. This is why I suggested to use an array of pools. This way reallocs of vectors won't be proced.
You should note that if you reference the objects in the pool by index within the vector, than you don't need to care about the vector moving the data around in memory. This is the strength of indices, with the small drawback of one additional indirection to actually get the data.
And the usage of these pools should also be as simple as possible. If you need a pool for Ogres, make an instance if ObjectPool<Ogre> m_ogrePool in your game class, or some other logical place. Don't make the pools static, nor singletons, as you lock yourself from being able to make different pools for different levels or maps.