g++ template functions calling template functions.

David Sankel camio@yahoo.com
Tue Jan 20 21:10:00 GMT 2004


Claudio,

  Thanks for your help.  I was able to fix the bug realizing that the problem
was passing a temporary to a function that requires a non-const reference.

--- Claudio Bley <bley@cs.uni-magdeburg.de> wrote:
> I'm almost certain you were just too lazy... ;-)

  I wish that were so :).  Since I thought it was a problem with templates,
my test case didn't include other parameters.  Seems as though a lot of
misdirection played a part here.

> You can't pass a temporary object to a function as a non-const
> reference. (Btw, what is msft c++ and does it accept this code?)

Microsoft C++.  Visual Studio.NET 2003.  Yeah, accepted this code without any
complaint.

Thanks Again,

David J. Sankel



More information about the Gcc-help mailing list