Last active
December 29, 2021 02:04
-
-
Save LucianoPAlmeida/2550fca8a776c81432eb73ee6896d342 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
size_t val = 0; | |
// val expression is l-value | |
val = 1; | |
size_t fn() { // ... } | |
// Result of fn call expr is an r-value | |
fn(); | |
//It cannot be an l-value | |
fn() = val; // compilation error | |
size_t& fn_ref() { // ... } | |
//It is an l-value | |
fn_ref() = val; // allowed |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment