C++ 标准库
Contents
std::allocator
1 | template< class T > struct allocator; |
std::allocator
本质上就是 new/delete, 但是为什么需要它呢?
- 分离 allocation 和 construction(或者分离 deallocation 和 destruction)
- 主要的使用场景就是在实现container时
1 | template< class T > struct allocator; |
std::allocator
本质上就是 new/delete, 但是为什么需要它呢?