Edm*_*und 5 c++ stl
std::allocator是无国籍的。换句话说,由a1.allocate()(a1是 的一个实例std::allocator)分配的内存可以由a2.deallocate()(a2是 的另一个实例std::allocator)释放。
std::allocator
a1.allocate()
a1
a2.deallocate()
a2
为什么它们不是静态成员函数?
(2014 年 10 月 17 日编辑:)
好的,感谢 luk32。由于 C++11 自定义allocator可以有状态,这可能是为什么std::allocator有那些非静态成员函数的原因。
allocator
归档时间:
11 年,1 月 前
查看次数:
255 次
最近记录:
5 年,8 月 前