Simple C++ object pool
You might change:

void release(T* element, unsigned int index) {
    if (&amp;m_objects[index] != element) {
            std::cerr &lt;&lt; "no match index and element\n";
            return; // or exit(1);
    }
    m_occupied_registry[index] = false; // mark the released element as free
    m_releaser(element); // call release functor
}


and at the acquire  change the return line:

    return pointer(&amp;m_objects[index], [this,index](T* element)-&gt;void{release(element,index);});


The above will improve the efficiency of the release operation, as you don't need to search for the element.