摘要:
/ *ObjectPool.h */#include <iostream>#include <queue>#include <vector>template <typename T>class ObjectPool{public: ObjectPool(size_t chunk_size = kdefault_size); ~ObjectPool(); T& acquire_object(); void release_object(T& obj);protected: void allocate_chunk(); static 阅读全文