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:
35
docs/api/containers/hashmap/size.md
Normal file
35
docs/api/containers/hashmap/size.md
Normal file
@@ -0,0 +1,35 @@
|
||||
# HashMap::Size / Empty
|
||||
|
||||
```cpp
|
||||
size_t Size() const;
|
||||
bool Empty() const;
|
||||
```
|
||||
|
||||
获取哈希表的元素数量或判断是否为空。
|
||||
|
||||
**参数:** 无
|
||||
|
||||
**返回:**
|
||||
- `Size()` - 返回元素数量
|
||||
- `Empty()` - 容器为空返回 `true`,否则返回 `false`
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
XCEngine::Containers::HashMap<int, const char*> map;
|
||||
|
||||
std::cout << "Empty: " << (map.Empty() ? "yes" : "no") << std::endl; // 输出 "yes"
|
||||
std::cout << "Size: " << map.Size() << std::endl; // 输出 0
|
||||
|
||||
map.Insert(1, "one");
|
||||
map.Insert(2, "two");
|
||||
|
||||
std::cout << "Empty: " << (map.Empty() ? "yes" : "no") << std::endl; // 输出 "no"
|
||||
std::cout << "Size: " << map.Size() << std::endl; // 输出 2
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [HashMap 总览](hashmap.md) - 返回类总览
|
||||
Reference in New Issue
Block a user