docs: update containers API docs
This commit is contained in:
@@ -8,7 +8,8 @@ void PushBack(T&& value);
|
||||
在数组末尾添加一个元素。
|
||||
|
||||
**拷贝版本(`const T&`):**
|
||||
- 如果容量不足(`Size() >= Capacity()`),先扩容(容量翻倍)
|
||||
- 如果容量不足(`m_size >= m_capacity`),先扩容
|
||||
- 当容量为0时,首次扩容至4;之后每次扩容翻倍(即 4 → 8 → 16 → ...)
|
||||
- 在末尾位置拷贝构造 `value`
|
||||
|
||||
**移动版本(`T&&`):**
|
||||
@@ -25,7 +26,7 @@ void PushBack(T&& value);
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
Containers::Array<std::string> arr;
|
||||
XCEngine::Containers::Array<std::string> arr;
|
||||
|
||||
// 拷贝添加
|
||||
std::string s = "hello";
|
||||
|
||||
Reference in New Issue
Block a user