Intermediate
C++
Q52 / 100
What is perfect forwarding?
Correct! Well done.
Incorrect.
The correct answer is B) Forwarding arguments to another function preserving lvalue/rvalue category via std::forward
B
Correct Answer
Forwarding arguments to another function preserving lvalue/rvalue category via std::forward
Explanation
template<typename T> void wrapper(T&& arg) { target(std::forward<T>(arg)); } forwards lvalues as lvalues and rvalues as rvalues, avoiding unnecessary copies.
Progress
52/100