Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Foo {
- public:
- int a, b;
- Foo(int a, int b) : a(a), b(b) {
- }
- };
- int main()
- {
- Foo foo(14, 88);
- auto& foo_ref = foo; //lvalue reference
- auto&& foo_ref2 = foo;
- auto foo2 = foo_ref; //copy
- auto foo3 = foo_ref2; //move
- //foo, foo_ref and foo_ref2 are invalid now
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement