This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Puzzled by const string& parameter


>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?



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]