docs: update containers API docs

This commit is contained in:
2026-03-20 02:35:01 +08:00
parent a647f5e8ec
commit 0c073db4e8
33 changed files with 135 additions and 56 deletions

View File

@@ -7,7 +7,7 @@ void Reserve(size_t capacity);
预分配底层内存容量,确保能容纳至少 `capacity` 个元素而不重新分配。
**行为:**
- 如果 `capacity > Capacity()`,分配新内存(容量翻倍策略)
- 如果 `capacity > Capacity()`,分配新内存并拷贝现有元素
- 如果 `capacity <= Capacity()`,什么都不做
- 不改变 `Size()`
@@ -23,7 +23,7 @@ void Reserve(size_t capacity);
**示例:**
```cpp
Containers::Array<int> arr;
XCEngine::Containers::Array<int> arr;
// 预分配 1000 个元素的容量
arr.Reserve(1000);