← Back to Question List
C++ Quiz #125
Which identify Overload Runs
Two overloads of identify exist: one takes T&, the other takes T&&. What is printed?
📄 Code
1#include <iostream>23template <typename T>4void identify(T&) {5 std::cout << "Lvalue\n";6}78template <typename T>9void identify(T&&) {10 std::cout << "Rvalue\n";11}1213int main() {14 int x = 1;15 identify(x);16 identify(5);17 identify(x + 1);18 return 0;19}