using namespace std;
friend string operator+(test);
string operator+(string &c,test a)
test d("the ");
string s="Hello ";
the second last line s=s+d+e; after the fist overloaded operator + it returned a temporary object,and the second overloaded operator + unexpectedly worked!But the first parameter of operator+ function is a reference. why the reference of temporary object is valid here,or there is something i have missed?
P.S: It's compiled by VC++6.0 and here is the running result.