Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- class Foo
- {
- public:
- Foo(){cout << "Foo()" << endl;};
- Foo(Foo&& f)
- {
- cout << "Foo(Foo&&)" << endl;
- this->x = 1;
- }
- Foo(const Foo& f)
- {
- cout << "Foo(const Foo&)" << endl;
- this->x =2;
- }
- int x;
- static Foo get(){return Foo();}
- };
- int main(int argc, char* argv[])
- {
- Foo foo2(Foo::get());
- return 0;
- }
- "Foo()".
- "Foo()"
- "Foo(&&)"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement