/*
Name: temporary varity copy consturctor
Copyright:
Author: elprup
Date: 08/10/10 09:18
Description:
*/
#include <cstdlib>
#include <iostream>
using namespace std;
class bar;
class foo
{
public:
foo():pb(0){}
// do this if not define operator bar &
foo(bar& b){cout<<"copy constructor"<<endl;}
foo& operator=(const foo& f){cout<<"operator equal"<<endl; return *this;}
// if define function below, skip copy constructor and oprator= foo
foo& operator=(const bar& b){cout<<"bar operator equal"<<endl; return *this;}
private:
bar *pb;
};
class bar
{
};
int main()
{
foo f;
f = b;
system("PAUSE");
return 0;
}