mirror of
https://github.com/changkun/modern-cpp-tutorial.git
synced 2025-12-17 12:44:40 +03:00
16
code/3/3.4.historical.cpp
Normal file
16
code/3/3.4.historical.cpp
Normal file
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// 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;
|
||||
}
|
||||
Reference in New Issue
Block a user