Created
January 18, 2012 20:53
-
-
Save arturo182/1635571 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
#include <iostream> | |
using namespace std; | |
class J | |
{ | |
public: | |
J() { cout << "J::J()" << endl; } | |
J(const J&) { cout << "J::J(&J)" << endl; } | |
J& operator =(const J&) { cout << "J::operator=()" << endl; } | |
}; | |
class I | |
{ | |
public: | |
I() { cout << "I::I()" << endl; } | |
I(const I&) { cout << "I::I(&I)" << endl; } | |
I& operator =(const I&) { cout << "I::operator=()" << endl; } | |
}; | |
class X | |
{ | |
public: | |
I m_i; | |
J m_j; | |
X(I i, J j): m_i(i) | |
{ | |
m_j = j; | |
} | |
}; | |
int main() | |
{ | |
J j; | |
I i; | |
cout << "start" << endl; | |
X x(i, j); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment