← Back to Question List
C++ Quiz #127
A Named Rvalue Reference Is Still an Lvalue
inspect receives the literal 7 through an rvalue reference named value. Inside it, value is passed to label twice. What is printed?
📄 Code
1#include <iostream>2#include <utility>34void label(int&) {5 std::cout << "Lvalue\n";6}78void label(int&&) {9 std::cout << "Rvalue\n";10}1112void inspect(int&& value) {13 label(value);14 label(std::move(value));15}1617int main() {18 inspect(7);19 return 0;20}