Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- struct A {
- void foo() & { std::cout << "l ref" << std::endl; }
- void foo() const & { std::cout << "const l ref" << std::endl; }
- void foo() && { std::cout << "r ref" << std::endl; }
- };
- int main(int argc, char* argv[])
- {
- (void)argc;
- (void)argv;
- A l;
- const A constl;
- l.foo();
- constl.foo();
- std::move(l).foo();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement