Skip to content

Instantly share code, notes, and snippets.

@arturo182
Created January 18, 2012 20:53
Show Gist options
  • Save arturo182/1635571 to your computer and use it in GitHub Desktop.
Save arturo182/1635571 to your computer and use it in GitHub Desktop.
#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