What does an r-value reference look like from a lower-level perspective. I just can't seem to wrap my head around it! Can I see an example of generated code (either equivalent C or x86/x64) from a r-value reference vs. a l-value reference?
For example, what would this construct look like? Let's assume no copy elision for now.
vector<SomethingHUUGE> myFunc();
void foo(vector<SomethingHUUGE>&&);
int main() { foo(myFunc()); return 0; }
There is no difference for the purposes of code generation. The only semantic difference between the two is that you know an RValue reference is about to be destroyed, while an lvalue reference will not.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With