Created
July 21, 2014 15:31
-
-
Save c9s/0c3e679ea81118147989 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* test.cc | |
* Copyright (C) 2014 c9s <c9s@c9smba.local> | |
* | |
* Distributed under terms of the MIT license. | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <iostream> | |
using namespace std; | |
class Foo { | |
public: | |
Foo() { | |
cout << "constructor" << endl; | |
} | |
Foo(const Foo& f) { | |
cout << "copy-constructor" << endl; | |
} | |
~Foo() { | |
cout << "destructor" << endl; | |
} | |
Foo& operator =(const Foo& a) { | |
cout << "operator =" << endl; | |
return *this; | |
} | |
}; | |
void bar(Foo foo) { | |
} | |
int main() { | |
Foo a; | |
bar(a); | |
Foo b; | |
b = a; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment