fix: improve doc link navigation and tree display
- Fix link resolution with proper relative/absolute path handling - Improve link styling with underline decoration - Hide leaf nodes from tree, only show directories - Fix log file path for packaged app
This commit is contained in:
34
docs/api/containers/hashmap/clear.md
Normal file
34
docs/api/containers/hashmap/clear.md
Normal file
@@ -0,0 +1,34 @@
|
||||
# HashMap::Clear
|
||||
|
||||
```cpp
|
||||
void Clear();
|
||||
```
|
||||
|
||||
清空哈希表中的所有元素,将元素数量置为 0。桶的数量保持不变。
|
||||
|
||||
**参数:** 无
|
||||
|
||||
**返回:** 无
|
||||
|
||||
**复杂度:** O(m_bucketCount),需要清空所有桶
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
XCEngine::Containers::HashMap<int, const char*> map;
|
||||
map.Insert(1, "one");
|
||||
map.Insert(2, "two");
|
||||
map.Insert(3, "three");
|
||||
|
||||
std::cout << "Size before clear: " << map.Size() << std::endl; // 输出 3
|
||||
|
||||
map.Clear();
|
||||
|
||||
std::cout << "Size after clear: " << map.Size() << std::endl; // 输出 0
|
||||
std::cout << "Empty: " << (map.Empty() ? "yes" : "no") << std::endl; // 输出 "yes"
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [HashMap 总览](hashmap.md) - 返回类总览
|
||||
- [Erase](erase.md) - 删除单个元素
|
||||
Reference in New Issue
Block a user