Affected files: .obsidian/workspace 02. PARA/03. Resources(資源)/C++17/lvalue.md 02. PARA/03. Resources(資源)/C++17/rvalue.md 02. PARA/03. Resources(資源)/git/submodule.md
14 lines
419 B
Markdown
14 lines
419 B
Markdown
rvalue 是指:
|
||
- 等號右邊的值
|
||
- 臨時的值,例如運算的結果
|
||
- 無法被取址(address-of)的物件
|
||
|
||
可以用`&&`來參考rvalue。例如:
|
||
```cpp
|
||
int c{5};
|
||
int&& rtepm {c + 3}; // rtepm等於c + 3的結果
|
||
```
|
||
|
||
## 參考
|
||
- [Value categories - cppreference.com](https://en.cppreference.com/w/cpp/language/value_category)
|
||
- [rvalue 參考](https://openhome.cc/Gossip/CppGossip/RvalueReference.html) |