Made an Object pool in C++
This looks way too overengineered. Is there really a need for all the complexity? Use the KISS principle!

I'm assuming you have this pool because you want to avoid the cost of constructing and destructing Objects, and possibly to allocate a lot of instances of Object up front to avoid latency later on. If that's the case, I would instead write the pool like so:

template&lt;typename Object&gt;
class ObjectPool: private NonCopyable
{
    std::deque&lt;std::unique_ptr&lt;Object&gt;&gt; m_objects;

public:
    ObjectPool(size_t count = 0) {
        for(size_t i = 0; i &lt; count; ++i) {
            auto object = std::make_unique&lt;Object&gt;();
            enqueue(object);
        }
    }

    std::unique_ptr&lt;Object&gt; dequeue() {
        if (m_objects.empty()) {
            return std::make_unique&lt;Object&gt;();
        } else {
            auto object = std::move(m_objects.back());
            m_objects.pop_back();
            return object;
        }
    }

    void enqueue(std::unique_ptr&lt;Object&gt; &amp;object) {
        m_objects.emplace_back(std::move(object));
    }
};


First, the constructor of this object pool just takes the initial size of the pool as a single value, so it doesn't have to know the specifics of chunk sizes.

Second, the dequeue() function creates a new object for you automatically if the pool is empty. Maybe that is not desired, in which you could return an empty std::unique_pointer instead.

Last but not least, instead of leaving it up to the destructor of an ObjectFromPool to return the object back to the pool it came from, there is now a counterpart to dequeue(): enqueue(). It simply returns an object back to its pool. This avoids having to wrap objects in custom classes.

The only issue with this solution might be that you forget to return an object to its pool, but on the other hand it will still safely destruct itself once its lifetime ends.