0% found this document useful (0 votes)
40 views5 pages

Modern C Overview Part Three Exercises

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
40 views5 pages

Modern C Overview Part Three Exercises

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Modern C++ Overview

Part Three Exercises

Copyright © James Raynard 2023


lvalue and rvalue
• Explain briefly what is meant by the terms "lvalue" and "rvalue" in
C++
• Give some examples

Copyright © James Raynard 2023


lvalue and rvalue references
• Explain briefly what is meant by the terms "lvalue reference" and
"rvalue reference"

Copyright © James Raynard 2023


Rvalue reference
• Write a function which has an rvalue reference as argument
• Write a program which calls this function, passing an rvalue to it
• Alter your program so that it passes an lvalue to it
• Explain your results

Copyright © James Raynard 2023


std::move
• Modify your program from the previous slide so that it works when
passing an lvalue
• What implications does this have?

Copyright © James Raynard 2023

You might also like