Ensure preallocation of a number of items.
Reserve() won't change the Length() of the array and does nothing if in_ulReserve is smaller or equal to current Reserved() size.
If an allocation occurs, i.e. in_ulReserve > Reserved(), all iterators and all references to the array elements are invalidated.
- 注解
- When template parameter
TGrowBy = AkGrowByPolicy_NoGrow, Reserve() shall only be called if the current reserved size is zero. It should normally only be called once on init.
-
When template parameter
TGrowBy = AkGrowByPolicy_Proportional, inappropriate calls to Reserve(), e.g. calling it before every AddLast(), may increase the number of reallocations and result in decreased performance.
在文件 AkArray.h 第 530 行定义.
被这些函数引用 AkArray::ReserveExtra().