Generic, efficient, thread safe connection pooling for C++