Puzzled by const string& parameter

Neo Anderson neo_in_matrix@msn.com
Fri Jun 24 16:02:00 GMT 2005


 >Can you tell me where the DOH is?

Your example does not involve a temporary, which was the point of the 
example I was trying to contrive, and mimics the situation you had 
originally inquired about.



What about this:
void test(string& s)
{
s = "abc";
}

test(string("123");

If this code compiles under gcc, where is the DOH?




More information about the Gcc-help mailing list