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:
38
docs/api/containers/array/front-back.md
Normal file
38
docs/api/containers/array/front-back.md
Normal file
@@ -0,0 +1,38 @@
|
||||
# Array::Front() / Back()
|
||||
|
||||
```cpp
|
||||
T& Front();
|
||||
const T& Front() const;
|
||||
T& Back();
|
||||
const T& Back() const;
|
||||
```
|
||||
|
||||
获取数组首尾元素的引用。
|
||||
|
||||
**Front():** 返回第一个元素(`index == 0`)的引用。
|
||||
|
||||
**Back():** 返回最后一个元素(`index == Size() - 1`)的引用。
|
||||
|
||||
**前置条件:** 数组必须非空,否则行为未定义。
|
||||
|
||||
**返回:** 首/尾元素的引用
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
**线程安全:** ❌ 访问期间不可并发修改
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
Containers::Array<int> arr = {10, 20, 30};
|
||||
|
||||
int& first = arr.Front(); // first == 10
|
||||
int& last = arr.Back(); // last == 30
|
||||
|
||||
arr.Front() = 5; // arr 现在是 {5, 20, 30}
|
||||
arr.Back() = 100; // arr 现在是 {5, 20, 100}
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [Array 总览](array.md) - 返回类总览
|
||||
Reference in New Issue
Block a user