mirror of
https://github.com/changkun/modern-cpp-tutorial.git
synced 2025-12-17 20:54:39 +03:00
16 lines
370 B
C++
16 lines
370 B
C++
//
|
|
// 3.4.historical.cpp
|
|
// modern c++ tutorial
|
|
//
|
|
// created by changkun at changkun.de
|
|
// https://github.com/changkun/modern-cpp-tutorial
|
|
//
|
|
|
|
#include <iostream>
|
|
|
|
int main() {
|
|
// int &a = std::move(1); // illegal, non-const lvalue reference cannot ref rvalue
|
|
const int &b = std::move(1); // legal, const lvalue reference can
|
|
|
|
std::cout << b << std::endl;
|
|
} |